Simplify "registerProblem" util methods in CompatibilityVisitor

This commit is contained in:
Semyon Proshev
2016-09-26 15:32:24 +03:00
parent 137c3cbd80
commit 94fb4a845b
3 changed files with 3 additions and 26 deletions
@@ -147,15 +147,6 @@ public class PyCompatibilityInspection extends PyInspection {
myHolder = holder;
}
@Override
protected final void registerProblem(@Nullable PsiElement node,
@NotNull String message,
@Nullable LocalQuickFix localQuickFix,
boolean asError) {
if (node == null) return;
registerProblem(node, node.getTextRange(), message, localQuickFix, asError);
}
@Override
protected void registerProblem(@NotNull PsiElement element,
@NotNull TextRange range,
@@ -538,22 +538,17 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
}
}
protected abstract void registerProblem(@Nullable PsiElement node,
@NotNull String message,
@Nullable LocalQuickFix localQuickFix,
boolean asError);
protected abstract void registerProblem(@NotNull PsiElement node,
@NotNull TextRange range,
@NotNull String message,
@Nullable LocalQuickFix localQuickFix,
boolean asError);
protected void registerProblem(@Nullable PsiElement node, @NotNull String message, @Nullable LocalQuickFix localQuickFix) {
registerProblem(node, message, localQuickFix, true);
protected void registerProblem(@NotNull PsiElement node, @NotNull String message, @Nullable LocalQuickFix localQuickFix) {
registerProblem(node, node.getTextRange(), message, localQuickFix, true);
}
protected void registerProblem(@Nullable PsiElement node, @NotNull String message) {
protected void registerProblem(@NotNull PsiElement node, @NotNull String message) {
registerProblem(node, message, null);
}
@@ -46,15 +46,6 @@ public class UnsupportedFeatures extends CompatibilityVisitor {
setVersionsToProcess(Arrays.asList(LanguageLevel.forElement(node)));
}
@Override
protected void registerProblem(@Nullable PsiElement node,
@NotNull String message,
@Nullable LocalQuickFix localQuickFix,
boolean asError) {
if (node == null) return;
registerProblem(node, node.getTextRange(), message, localQuickFix, asError);
}
@Override
protected void registerProblem(@NotNull PsiElement node,
@NotNull TextRange range,