| author | Samrat Dhillon | 2012-04-23 02:12:53 (EDT) |
|---|---|---|
| committer | Satyam Kandula | 2012-04-23 02:12:53 (EDT) |
| commit | 4f8b41427e5710e37012dc18560acc142566864b (patch) (side-by-side diff) | |
| tree | c81b4e5e2f74834eae090d7aced26d7c22490d9b | |
| parent | f8411b1adc8157c7b4c8cbbec84a1879b6a280c9 (diff) | |
| download | eclipse.jdt.core-4f8b41427e5710e37012dc18560acc142566864b.zip eclipse.jdt.core-4f8b41427e5710e37012dc18560acc142566864b.tar.gz eclipse.jdt.core-4f8b41427e5710e37012dc18560acc142566864b.tar.bz2 | |
Fix for 357547: [search] Search for method references is returning
methods as overriden even if the superclass's method is only
package-visible
| -rw-r--r-- | org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java | 7 |
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 9b48938..c1c1522 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; |

