mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
AIOOBE
This commit is contained in:
@@ -173,6 +173,10 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
final PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
final PsiExpression[] expressions = ((PsiExpressionList)myArgumentList).getExpressions();
|
||||
|
||||
if (!isVarargs() && expressions.length != parameters.length) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < expressions.length; i++) {
|
||||
final PsiExpression expression = expressions[i];
|
||||
PsiType formalParameterType = i < parameters.length ? parameters[i].getType() : parameters[parameters.length - 1].getType();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
class BB {
|
||||
public boolean isVarArgCall() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isVarArgCall(String method, String substitutor) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
void f(BB b){
|
||||
BB.<error descr="Non-static method 'isVarArgCall()' cannot be referenced from a static context">isVarArgCall</error>();
|
||||
}
|
||||
}
|
||||
@@ -183,6 +183,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIgnoreNumberOfParametersInPotentiallyCompatibleCheckNotToExcludeAllConflicts() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user