mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
untie static methods in interface hierarchy (IDEA-118577)
This commit is contained in:
@@ -273,7 +273,12 @@ public class PsiSuperMethodImplUtil {
|
||||
if (superClass != null) {
|
||||
if (superClass.isInterface() ||
|
||||
CommonClassNames.JAVA_LANG_OBJECT.equals(superClass.getQualifiedName())) {
|
||||
if (superMethod.hasModifierProperty(PsiModifier.DEFAULT) || hierarchicalMethodSignature.getMethod().hasModifierProperty(PsiModifier.DEFAULT)) {
|
||||
if (superMethod.hasModifierProperty(PsiModifier.STATIC) ||
|
||||
hierarchicalMethodSignature.getMethod().hasModifierProperty(PsiModifier.STATIC)) {
|
||||
return false;
|
||||
}
|
||||
if (superMethod.hasModifierProperty(PsiModifier.DEFAULT) ||
|
||||
hierarchicalMethodSignature.getMethod().hasModifierProperty(PsiModifier.DEFAULT)) {
|
||||
return !InheritanceUtil.isInheritorOrSelf(superClass, containingClass, true);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
interface A
|
||||
{
|
||||
static void foo(){}
|
||||
}
|
||||
interface B extends A
|
||||
{
|
||||
static int foo(){ return 1; }
|
||||
}
|
||||
@@ -32,6 +32,7 @@ public class Interface8MethodsHighlightingTest extends LightDaemonAnalyzerTestCa
|
||||
public void testThisAccessibility() { doTest(false, false); }
|
||||
public void testStaticMethodCalls() { doTest(false, false); }
|
||||
public void testDefaultMethodOverrideEquivalentObject() { doTest(false, false); }
|
||||
public void testStaticMethods() { doTest(false, false); }
|
||||
public void testDefaultSupersInStaticContext() {
|
||||
doTest(false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user