replace duplicates when pull methods up

This commit is contained in:
anna
2011-06-20 21:21:07 +04:00
parent 91d3996e1c
commit e32cc3c855
9 changed files with 141 additions and 33 deletions
@@ -0,0 +1,18 @@
class A {}
class AImpl1 extends A{
void f<caret>oo() {
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
}
}
class AImpl2 extends A {
void bar() {
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
}
}
@@ -0,0 +1,16 @@
class A {
void foo() {
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
System.out.println("hello");
}
}
class AImpl1 extends A{
}
class AImpl2 extends A {
void bar() {
foo();
}
}
@@ -94,6 +94,10 @@ public class PullUpTest extends LightCodeInsightTestCase {
doTest(new RefactoringTestUtil.MemberDescriptor("method", PsiMethod.class, true));
}
public void testReplaceDuplicatesInInheritors() throws Exception {
doTest(new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class, false));
}
public void testGenericsInImplements() throws Exception {
doTest(false, new RefactoringTestUtil.MemberDescriptor("I", PsiClass.class));
}