SAM: skip allowed static methods as they are not supposed to be overridden (IDEA-101403)

This commit is contained in:
anna
2013-02-19 12:52:25 +01:00
parent 5682294b7e
commit 533ca9ace4
3 changed files with 13 additions and 0 deletions

View File

@@ -264,6 +264,7 @@ public class LambdaUtil {
for (HierarchicalMethodSignature signature : visibleSignatures) {
final PsiMethod psiMethod = signature.getMethod();
if (!psiMethod.hasModifierProperty(PsiModifier.ABSTRACT)) continue;
if (psiMethod.hasModifierProperty(PsiModifier.STATIC)) continue;
if (!overridesPublicObjectMethod(psiMethod)) {
methods.add(signature);
}

View File

@@ -0,0 +1,11 @@
public interface Nat {
interface Nil extends Nat {}
}
interface Inc extends Nat {
Nat dec();
static Inc make(Nat dec) {
return () -> dec;
}
}

View File

@@ -28,6 +28,7 @@ public class Interface8MethodsHighlightingTest extends LightDaemonAnalyzerTestCa
public void testInheritUnrelatedDefaults() { doTest(true, false); }
public void testExtensionMethods() { doTest(false, false); }
public void testInheritDefaultMethodInInterface() { doTest(false, false); }
public void testStaticMethodsInFunctionalInterface() { doTest(false, false); }
public void testExtensionMethodSyntax() {
enableInspectionTools(DeprecatedDefenderSyntaxInspection.class);