mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
rename: qualify to avoid undiagnosed shadowing ( IDEA-20634 )
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
class A {
|
||||
class <caret>B {
|
||||
int x = 42;
|
||||
}
|
||||
}
|
||||
|
||||
public class D {
|
||||
static class C extends A {
|
||||
int x = 23;
|
||||
|
||||
int m() {
|
||||
return C.this.x;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new C().m());
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class A {
|
||||
class C {
|
||||
int x = 42;
|
||||
}
|
||||
}
|
||||
|
||||
public class D {
|
||||
static class C extends A {
|
||||
int x = 23;
|
||||
|
||||
int m() {
|
||||
return D.C.this.x;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new C().m());
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class A {
|
||||
static class <caret>B {
|
||||
static int x = 42;
|
||||
}
|
||||
}
|
||||
|
||||
public class D {
|
||||
static class C extends A {
|
||||
static int x = 23;
|
||||
|
||||
static int m() {
|
||||
return C.x;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(C.m());
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class A {
|
||||
static class C {
|
||||
static int x = 42;
|
||||
}
|
||||
}
|
||||
|
||||
public class D {
|
||||
static class C extends A {
|
||||
static int x = 23;
|
||||
|
||||
static int m() {
|
||||
return D.C.x;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(D.C.m());
|
||||
}
|
||||
}
|
||||
@@ -160,6 +160,14 @@ public class RenameCollisionsTest extends LightCodeInsightTestCase {
|
||||
doTest("P");
|
||||
}
|
||||
|
||||
public void testRenameInnerInSuperClass() throws Exception {
|
||||
doTest("C");
|
||||
}
|
||||
|
||||
public void testRenameInnerInSuperClassStatic() throws Exception {
|
||||
doTest("C");
|
||||
}
|
||||
|
||||
private void doTest(final String newName) throws Exception {
|
||||
configureByFile(BASE_PATH + getTestName(false) + ".java");
|
||||
PsiElement element = TargetElementUtilBase
|
||||
|
||||
Reference in New Issue
Block a user