mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 21:41:24 +07:00
SAM: skip allowed static methods as they are not supposed to be overridden (IDEA-101403)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
public interface Nat {
|
||||
interface Nil extends Nat {}
|
||||
}
|
||||
|
||||
interface Inc extends Nat {
|
||||
Nat dec();
|
||||
|
||||
static Inc make(Nat dec) {
|
||||
return () -> dec;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user