mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IPP: fix AIOOBE
This commit is contained in:
@@ -60,7 +60,7 @@ class VarargArgumentsPredicate implements PsiElementPredicate {
|
||||
if (!JavaGenericsUtil.isReifiableType(substitutedType)) {
|
||||
return false;
|
||||
}
|
||||
if (arguments.length > parameters.length) {
|
||||
if (arguments.length != parameters.length) {
|
||||
return true;
|
||||
}
|
||||
final PsiExpression lastExpression = arguments[arguments.length - 1];
|
||||
|
||||
@@ -105,4 +105,20 @@ public class WrapVarargArgumentsWithExplicitArrayIntentionTest extends IPPTestCa
|
||||
"}"
|
||||
);
|
||||
}
|
||||
|
||||
public void testEmptyArray() {
|
||||
doTest(
|
||||
"class X {" +
|
||||
" void x() {" +
|
||||
" java.util.Arrays.asList(/*_Wrap vararg arguments with explicit array creation*/);" +
|
||||
" }" +
|
||||
"}",
|
||||
|
||||
"class X {" +
|
||||
" void x() {" +
|
||||
" java.util.Arrays.asList(new Object[]{});" +
|
||||
" }" +
|
||||
"}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user