mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
introduce parameter: ensure varargs are not substituted twice (IDEA-161779)
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
class Test {
|
||||
|
||||
void f(String strings) {
|
||||
final String[] strings1 = new String[]{"c", "d"};
|
||||
final String foo = foo(strings1);
|
||||
extract("a", "b", foo);
|
||||
}
|
||||
|
||||
private static void extract(final String from, final String to, String anObject) {
|
||||
|
||||
}
|
||||
|
||||
public String foo(String[] extensions) {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
|
||||
void f(String strings) {
|
||||
extract("a", "b", "c", "d");
|
||||
}
|
||||
|
||||
private static void extract(final String from, final String to, final String... extensions) {
|
||||
|
||||
<selection>foo(extensions)</selection>;
|
||||
}
|
||||
|
||||
public String foo(String[] extensions) {
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -158,6 +158,10 @@ public class IntroduceParameterTest extends LightRefactoringTestCase {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE, true, false, false, false);
|
||||
}
|
||||
|
||||
public void testMethodCallRefToVararg() throws Exception {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE, true, false, false, false);
|
||||
}
|
||||
|
||||
public void testSuperWithSideEffect() {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE, false, false, false, false,
|
||||
"Parameter initializer contains <b><code>super</code></b>, but not all calls to method are in its class");
|
||||
|
||||
Reference in New Issue
Block a user