mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
extract method: qualify with this if needed when target class differs from call place's one
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user