mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
check for list size: skiped varargs parameter (16666)
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@ public class ChangeSignatureUtil {
|
||||
if (elementsToRemove == null) {
|
||||
elementsToRemove = new ArrayList<Child>();
|
||||
for (int i = 0; i < shouldRemoveChild.length; i++) {
|
||||
if (shouldRemoveChild[i]) {
|
||||
if (shouldRemoveChild[i] && i < elements.size()) {
|
||||
elementsToRemove.add(elements.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class Test {
|
||||
void fo<caret>o(int i, int ... ja){
|
||||
}
|
||||
|
||||
void bar() {
|
||||
foo(0);
|
||||
foo(0, 1);
|
||||
foo(0, 1, 2);
|
||||
foo(0, new int[]{3, 4});
|
||||
foo(0, new int[0]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Test {
|
||||
void foo(int i){
|
||||
}
|
||||
|
||||
void bar() {
|
||||
foo(0);
|
||||
foo(0);
|
||||
foo(0);
|
||||
foo(0);
|
||||
foo(0);
|
||||
}
|
||||
}
|
||||
@@ -129,6 +129,10 @@ public class ChangeSignatureTest extends LightCodeInsightTestCase {
|
||||
}, false);
|
||||
}
|
||||
|
||||
public void testRemoveVarargParameter() throws Exception {
|
||||
doTest(null, null, null, new ParameterInfoImpl[]{new ParameterInfoImpl(0)}, new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
public void testEnumConstructor() throws Exception {
|
||||
doTest(null, new ParameterInfoImpl[] {
|
||||
new ParameterInfoImpl(-1, "i", PsiType.INT, "10")
|
||||
|
||||
Reference in New Issue
Block a user