introduce parameter: substitute type parameters on call site

This commit is contained in:
anna
2011-09-08 19:27:53 +02:00
parent 24fe648832
commit 94bb0729c0
5 changed files with 44 additions and 3 deletions
@@ -0,0 +1,11 @@
import java.util.*;
class Test {
<T> void foo(T t, final ArrayList<T> anObject) {
List<T> ls = anObject;
}
void bar() {
String s = "";
foo(s, new ArrayList<String>());
}
}
@@ -0,0 +1,11 @@
import java.util.*;
class Test {
<T> void foo(T t) {
List<T> ls = <selection>new ArrayList<T>()</selection>;
}
void bar() {
String s = "";
foo(s);
}
}
@@ -276,6 +276,10 @@ public class IntroduceParameterTest extends LightCodeInsightTestCase {
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
}
public void testSubstituteTypeParams() throws Exception {
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
}
private void doTestThroughHandler() throws Exception {
configureByFile("/refactoring/introduceParameter/before" + getTestName(false) + ".java");
boolean enabled = true;