mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
move method: remove qualifier after calls corrections
This commit is contained in:
+1
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user