mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
static import when inheritance present (IDEA-158357)
This commit is contained in:
@@ -92,7 +92,7 @@ public class ImportsUtil {
|
||||
if (containingClass != null && stmt.resolveTargetClass() == containingClass) {
|
||||
if (!stmt.isOnDemand() && Comparing.strEqual(referenceName, member.getName())) {
|
||||
if (member instanceof PsiMethod) {
|
||||
return containingClass.findMethodsByName(referenceName, false).length == 1;
|
||||
return containingClass.findMethodsByName(referenceName, false).length > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package a;
|
||||
|
||||
import static a.A.foo;
|
||||
|
||||
interface B extends A {
|
||||
static void bar() {
|
||||
foo("");
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import bar.A;
|
||||
import static bar.A.foo;
|
||||
|
||||
class Usage {
|
||||
void bar() {
|
||||
A.foo();
|
||||
foo();
|
||||
}
|
||||
}
|
||||
+7
@@ -56,6 +56,13 @@ public class LightAdvHighlightingFixtureTest extends LightCodeInsightFixtureTest
|
||||
myFixture.checkHighlighting();
|
||||
}
|
||||
|
||||
public void testStaticImportCompoundWithInheritance() throws Exception {
|
||||
myFixture.addClass("package a; public interface A { static void foo(Object o){} static void foo(String str) {}}");
|
||||
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
myFixture.checkHighlighting();
|
||||
}
|
||||
|
||||
public void testSuppressedInGenerated() throws Exception {
|
||||
myFixture.addClass("package javax.annotation; public @interface Generated {}");
|
||||
final RedundantCastInspection inspection = new RedundantCastInspection();
|
||||
|
||||
Reference in New Issue
Block a user