mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
prefer extensions methods als interface (IDEA-96719)
This commit is contained in:
@@ -271,7 +271,9 @@ public class PsiSuperMethodImplUtil {
|
||||
if (superClass != null) {
|
||||
if (superClass.isInterface() ||
|
||||
CommonClassNames.JAVA_LANG_OBJECT.equals(superClass.getQualifiedName())) {
|
||||
return true;
|
||||
if (!superMethod.hasModifierProperty(PsiModifier.DEFAULT) || !InheritanceUtil.isInheritorOrSelf(superClass, containingClass, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (containingClass != null) {
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
interface OfInt extends Sink<Integer> {
|
||||
default void accept(Integer i) {}
|
||||
}
|
||||
interface Sink<T> extends Block<T> {
|
||||
}
|
||||
|
||||
interface Block<T> {
|
||||
public void accept(T t);
|
||||
}
|
||||
|
||||
|
||||
class Hello1 implements Sink<Integer>, OfInt {}
|
||||
class Hello2 implements OfInt, Sink<Integer>{}
|
||||
|
||||
+1
@@ -158,4 +158,5 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testUncheckedWarningIDEA60166() throws Exception { doTest(true, false); }
|
||||
public void testUncheckedWarningIDEA21432() throws Exception { doTest(true, false); }
|
||||
public void testUncheckedWarningIDEA26738() throws Exception { doTest(true, false); }
|
||||
public void testDefaultMethodVisibility() throws Exception { doTest(true, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user