AnnotatedElementInspectionBase javadoc and minor refactoring

This commit is contained in:
Yaroslav Pankratyev
2018-10-12 15:44:50 +07:00
parent a27b987e11
commit 3fc4644c53
2 changed files with 8 additions and 6 deletions
@@ -16,6 +16,11 @@ import org.jetbrains.uast.UastContextKt;
import javax.swing.*;
import java.util.List;
/**
* This class can be extended by inspections that should report usage of elements annotated with some particular annotation(s).
*
* @since 2018.3
*/
public abstract class AnnotatedElementInspectionBase extends LocalInspectionTool {
public boolean myIgnoreInsideImports = true;
@@ -25,7 +30,9 @@ public abstract class AnnotatedElementInspectionBase extends LocalInspectionTool
protected abstract void createProblem(@NotNull PsiReference reference, @NotNull ProblemsHolder holder);
protected abstract boolean shouldProcessElement(@NotNull PsiModifierListOwner element);
protected boolean shouldProcessElement(@NotNull PsiModifierListOwner element) {
return true;
}
@NotNull
@@ -24,9 +24,4 @@ public class ScheduledForRemovalInspection extends AnnotatedElementInspectionBas
String message = JvmAnalysisBundle.message("jvm.inspections.scheduled.for.removal.description", getReferenceText(reference));
holder.registerProblem(reference, message, ProblemHighlightType.LIKE_MARKED_FOR_REMOVAL);
}
@Override
protected boolean shouldProcessElement(@NotNull PsiModifierListOwner element) {
return true;
}
}