diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java index ccd1838..5ab3058 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java @@ -2758,7 +2758,11 @@ protected void reportMatching(TypeDeclaration type, IJavaElement parent, int acc AbstractMethodDeclaration method = methods[i]; Integer level = (Integer) nodeSet.matchingNodes.removeKey(method); int value = (level != null && matchedClassContainer) ? level.intValue() : -1; - reportMatching(method, type, enclosingElement, value, typeInHierarchy, nodeSet); + if ((type.bits & ASTNode.IsAnonymousType) != 0) { + reportMatching(method, type, parent, value, typeInHierarchy, nodeSet); + } else { + reportMatching(method, type, enclosingElement, value, typeInHierarchy, nodeSet); + } } }