mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correct check that all constructors are private for "Class with only 'private' constructors should be declared 'final'" inspection
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ public class ClassWithOnlyPrivateConstructorsInspectionBase extends BaseInspecti
|
||||
return;
|
||||
}
|
||||
for (PsiMethod constructor : constructors) {
|
||||
if (constructor.hasModifierProperty(PsiModifier.FINAL)) {
|
||||
if (!constructor.hasModifierProperty(PsiModifier.PRIVATE)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -49,6 +49,12 @@ public class ClassWithOnlyPrivateConstructorsInspectionTest extends LightInspect
|
||||
"}");
|
||||
}
|
||||
|
||||
public void testPublicConstructor() {
|
||||
doTest("class A {" +
|
||||
" public A() {}" +
|
||||
"}");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
|
||||
Reference in New Issue
Block a user