Skip to content

Commit 0b282b5

Browse files
committed
Fix testMethodReferencesElementPatternMultipleParamArguments01
Signed-off-by: Rob Stryker <[email protected]>
1 parent c822b18 commit 0b282b5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ private int matchMethodTypeArguments(ASTNode node, IMethodBinding method,
548548
// Now we have only declarations, so you need to check type Params instead of type args.
549549
ITypeBinding[] tmp = method.getTypeParameters();
550550
if( tmp != null && tmp.length > 0 ) {
551-
return goal != null && goal.length == tmp.length ? ERASURE_MATCH : IMPOSSIBLE_MATCH;
551+
return goal != null && goal.length == tmp.length ? ACCURATE_MATCH : IMPOSSIBLE_MATCH;
552552
}
553553
return ERASURE_MATCH;
554554
}
@@ -839,11 +839,12 @@ protected int resolveLevelForNodeWithMethodBinding(ASTNode messageSend,
839839
if( !invocationBinding.isRawMethod() && this.locator.pattern.hasTypeParameters()) {
840840
invocOrDeclLevel = findWeakerLevel(invocOrDeclLevel, ERASURE_MATCH);
841841
}
842+
} else {
843+
if (invocationBinding.isRawMethod() && (this.locator.pattern.hasTypeArguments() || this.locator.pattern.hasTypeParameters())) {
844+
invocOrDeclLevel = findWeakerLevel(invocOrDeclLevel, ERASURE_MATCH);
845+
}
842846
}
843847

844-
if (invocationBinding.isRawMethod() && (this.locator.pattern.hasTypeArguments() || this.locator.pattern.hasTypeParameters())) {
845-
invocOrDeclLevel = findWeakerLevel(invocOrDeclLevel, ERASURE_MATCH);
846-
}
847848
// receiver type
848849
if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) {
849850
// since any declaring class will do

0 commit comments

Comments
 (0)