mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
qualify statically imported methods if they conflict with local members (IDEA-156273)
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
package bar;
|
||||
public class Bar {
|
||||
public static Object bar() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package foo;
|
||||
import bar.Bar;
|
||||
|
||||
public class Foo {
|
||||
protected static Object bar() {
|
||||
return Bar.bar();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package foo;
|
||||
import bar.Bar;
|
||||
|
||||
public class Foo {
|
||||
protected static Object bar(int i) {
|
||||
return Bar.bar();
|
||||
}
|
||||
|
||||
static void bar(int i, int j) {}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package bar;
|
||||
public class Bar {
|
||||
public static Object createBar() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package foo;
|
||||
import static bar.Bar.createBar;
|
||||
public class Foo {
|
||||
protected static Object bar() {
|
||||
return createBar();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo;
|
||||
import static bar.Bar.createBar;
|
||||
public class Foo {
|
||||
protected static Object bar(int i) {
|
||||
return createBar();
|
||||
}
|
||||
|
||||
static void bar(int i, int j) {}
|
||||
}
|
||||
@@ -97,6 +97,10 @@ public class RenameMethodMultiTest extends MultiFileTestCase {
|
||||
doTest("p.Foo", "void foo()", "bar");
|
||||
}
|
||||
|
||||
public void testExpandStaticImportToAvoidConflictingResolve() throws Exception {
|
||||
doTest("bar.Bar", "void createBar()", "bar");
|
||||
}
|
||||
|
||||
private void doTest(final String methodSignature, final String newName) throws Exception {
|
||||
doTest(getTestName(false), methodSignature, newName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user