introduce parameter: extract and delete unused varargs parameter (IDEA-152294)

This commit is contained in:
Anna Kozlova
2016-02-29 16:45:33 +01:00
parent 584cef05ca
commit 32dd35be57
7 changed files with 145 additions and 10 deletions
@@ -0,0 +1,17 @@
class Test {
void f(String strings) {
final String[] strings1 = new String[]{"c", "d"};
extract("a", "b", strings1);
}
private static void extract(final String from, final String to, String[] anObject) {
new Foo(anObject);
}
private static class Foo {
public Foo(String[] extensions) {
}
}
}
@@ -0,0 +1,17 @@
class Test {
void f(String strings) {
final String[] strings1 = new String[]{"c", "d"};
final Foo foo = new Foo(strings1);
extract("a", "b", foo);
}
private static void extract(final String from, final String to, Foo anObject) {
}
private static class Foo {
public Foo(String[] extensions) {
}
}
}
@@ -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) {
new Foo(<selection>extensions</selection>);
}
private static class Foo {
public Foo(String[] extensions) {
}
}
}
@@ -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>new Foo(extensions)</selection>;
}
private static class Foo {
public Foo(String[] extensions) {
}
}
}