Move inspection to DevKit group + remove redundant suppression

This commit is contained in:
Alexander Zolotov
2016-03-07 17:16:47 +03:00
parent 9ecde83fc9
commit 6f026e54df
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -147,7 +147,7 @@
groupKey="inspections.group.name"
enabledByDefault="false" isInternal="true"
level="ERROR" implementationClass="org.jetbrains.idea.devkit.inspections.internal.HighlightVisitorInternalInspection"/>
<localInspection groupPath="Java" language="JAVA" shortName="QuickFixGetFamilyNameViolation"
<localInspection language="JAVA" shortName="QuickFixGetFamilyNameViolation"
displayName="QuickFix's getFamilyName() implementation must not depend on a specific context"
groupKey="inspections.group.name"
enabledByDefault="true"
@@ -34,14 +34,16 @@ public class QuickFixGetFamilyNameViolationInspection extends DevKitInspectionBa
@Nullable
@Override
public ProblemDescriptor[] checkMethod(@NotNull PsiMethod method, @NotNull InspectionManager manager, boolean isOnTheFly) {
if ("getFamilyName".equals(method.getName()) && method.getParameterList().getParametersCount() == 0 && !method.hasModifierProperty(PsiModifier.ABSTRACT)) {
if ("getFamilyName".equals(method.getName()) &&
method.getParameterList().getParametersCount() == 0 &&
!method.hasModifierProperty(PsiModifier.ABSTRACT)) {
final PsiClass aClass = method.getContainingClass();
if (InheritanceUtil.isInheritor(aClass, QuickFix.class.getName()) && doesMethodViolate(method)) {
final PsiIdentifier identifier = method.getNameIdentifier();
LOG.assertTrue(identifier != null);
//noinspection DialogTitleCapitalization
return new ProblemDescriptor[]{
manager.createProblemDescriptor(identifier, "QuickFix's getFamilyName() implementation must not depend on a specific context", (LocalQuickFix) null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, true)};
manager.createProblemDescriptor(identifier, "QuickFix's getFamilyName() implementation must not depend on a specific context",
(LocalQuickFix)null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, true)};
}
}
return null;