mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: don't ignore abstract classes (IDEA-191097)
This commit is contained in:
+2
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2015 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2018 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,17 +61,13 @@ public class AbstractMethodWithMissingImplementationsInspection
|
||||
@Override
|
||||
public void visitMethod(PsiMethod method) {
|
||||
super.visitMethod(method);
|
||||
if (method.getNameIdentifier() == null) {
|
||||
if (method.getNameIdentifier() == null || !method.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
return;
|
||||
}
|
||||
final PsiClass containingClass = method.getContainingClass();
|
||||
if (containingClass == null) {
|
||||
return;
|
||||
}
|
||||
if (!containingClass.isInterface() ||
|
||||
!method.hasModifierProperty(PsiModifier.ABSTRACT)) {
|
||||
return;
|
||||
}
|
||||
final InheritorFinder inheritorFinder = new InheritorFinder(containingClass);
|
||||
for (final PsiClass inheritor : inheritorFinder.getInheritors()) {
|
||||
if (hasMatchingImplementation(inheritor, method, containingClass)) {
|
||||
|
||||
+6
@@ -55,4 +55,10 @@ interface I2 {
|
||||
}
|
||||
<error descr="Class 'E2' must either be declared abstract or implement abstract method 'method()' in 'I2'">enum E2 implements I2</error> {
|
||||
A
|
||||
}
|
||||
abstract class Perspicacious {
|
||||
|
||||
abstract void <warning descr="Abstract method 'insightAndUnderstanding()' is not implemented in every subclass">insightAndUnderstanding</warning>();
|
||||
}
|
||||
<error descr="Class 'HighlyPerspicacious' must either be declared abstract or implement abstract method 'insightAndUnderstanding()' in 'Perspicacious'">class HighlyPerspicacious extends Perspicacious</error> {
|
||||
}
|
||||
Reference in New Issue
Block a user