Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java')
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
index 9b489387c1..c1c1522c6b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
@@ -7,6 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Samrat Dhillon samrat.dhillon@gmail.com - Search for method references is
+ * returning methods as overriden even if the superclass's method is
+ * only package-visible - https://bugs.eclipse.org/357547
*******************************************************************************/
package org.eclipse.jdt.internal.core.search.matching;
@@ -109,7 +112,9 @@ private boolean isTypeInSuperDeclaringTypeNames(char[][] typeName) {
* this message send or not.
*/
protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) {
- return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess();
+ return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess()
+ && !(method.isDefault() && this.pattern.focus != null
+ && !CharOperation.equals(this.pattern.declaringQualification, method.declaringClass.qualifiedPackageName()));
}
public int match(ASTNode node, MatchingNodeSet nodeSet) {
int declarationsLevel = IMPOSSIBLE_MATCH;

Back to the top