mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
introduce vararg variable from the selected enumeration (IDEA-82508)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
void foo(E... e) {
|
||||
}
|
||||
|
||||
void bar() {
|
||||
E[] strs = {E.E1, E.E2};
|
||||
foo(strs);
|
||||
}
|
||||
}
|
||||
|
||||
static enum E {
|
||||
E1, E2;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Test {
|
||||
void foo(E... e) {
|
||||
}
|
||||
|
||||
void bar() {
|
||||
foo(<selection>E.E1, E.E2</selection>);
|
||||
}
|
||||
}
|
||||
|
||||
static enum E {
|
||||
E1, E2;
|
||||
}
|
||||
@@ -202,6 +202,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
public void testArrayFromVarargs1() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("strs", false, false, false, "java.lang.String[]"));
|
||||
}
|
||||
|
||||
public void testEnumArrayFromVarargs() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("strs", false, false, false, "E[]"));
|
||||
}
|
||||
|
||||
public void testFromFinalFieldOnAssignment() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("strs", false, false, false, "java.lang.String"));
|
||||
|
||||
Reference in New Issue
Block a user