extract method: qualify with this if needed when target class differs from call place's one

This commit is contained in:
anna
2010-07-15 10:44:07 +04:00
parent d89b1efe4b
commit 37471e2d04
4 changed files with 36 additions and 0 deletions
@@ -0,0 +1,10 @@
public class Test {
void foo() {
new A() {
void fe() {<selection>System.out.println("");</selection>}
}
}
}
class A {
void newMethod(){}
}
@@ -0,0 +1,16 @@
public class Test {
void foo() {
new A() {
void fe() {
Test.this.newMethod();
}
}
}
private void newMethod() {
System.out.println("");
}
}
class A {
void newMethod(){}
}
@@ -168,6 +168,12 @@ public class ExtractMethodTest extends LightCodeInsightTestCase {
doTest();
}
public void testConflictingAnonymous() throws Exception {
doTest();
}
public void testFinalParamUsedInsideAnon() throws Exception {
CodeStyleSettingsManager.getSettings(getProject()).GENERATE_FINAL_PARAMETERS = false;
doTest();