Skip to content

Commit cd5703c

Browse files
committed
Better match level for method declarations with generics
1 parent b528432 commit cd5703c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/core/search/matching/DOMMethodLocator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ protected int resolveLevelForNodeWithMethodBinding(ASTNode messageSend,
720720
int matchLevel = (weakerMethod & PatternLocator.MATCH_LEVEL_MASK);
721721

722722
int retval = weakerMethod;
723+
if (messageSend instanceof MethodDeclaration && retval == ERASURE_MATCH && isEquivPattern) {
724+
return ACCURATE_MATCH;
725+
}
723726
if( matchLevel != ACCURATE_MATCH) {
724727
boolean isDefault = Modifier.isDefault(invocationOrDeclarationBinding.getModifiers());
725728
boolean nullFocus = this.pattern.focus == null;

0 commit comments

Comments
 (0)