move method: remove qualifier after calls corrections

This commit is contained in:
anna
2010-01-18 17:35:31 +03:00
parent f074aebd25
commit b06e294172
6 changed files with 69 additions and 1 deletions
@@ -440,8 +440,8 @@ public class MoveInstanceMethodProcessor extends BaseRefactoringProcessor{
}
@Override public void visitMethodCallExpression(PsiMethodCallExpression expression) {
super.visitMethodCallExpression(expression);
correctMethodCall(expression, true);
super.visitMethodCallExpression(expression);
}
});
}
@@ -0,0 +1,13 @@
public class A {
void f<caret>oo(B b) {
b.foo("");
}
}
class B {
void foo(String s) {
System.out.println(s);
}
}
@@ -0,0 +1,14 @@
public class A {
}
class B {
void foo(String s) {
System.out.println(s);
}
void foo() {
foo("");
}
}
@@ -0,0 +1,16 @@
public class A {
void f<caret>oo(B b) {
b.foo("");
if (false) {
foo(b);
}
}
}
class B {
void foo(String s) {
System.out.println(s);
}
}
@@ -0,0 +1,17 @@
public class A {
}
class B {
void foo(String s) {
System.out.println(s);
}
void foo() {
foo("");
if (false) {
foo();
}
}
}
@@ -49,6 +49,14 @@ public class MoveInstanceMethodTest extends LightCodeInsightTestCase {
doTest(true, 0, VisibilityUtil.ESCALATE_VISIBILITY);
}
public void testSameNames() throws Exception {
doTest(true, 0);
}
public void testSameNamesRecursion() throws Exception {
doTest(true, 0);
}
private void doTest(boolean isTargetParameter, final int targetIndex) throws Exception {
doTest(isTargetParameter, targetIndex, null);
}