mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't allow the "Inspection suppression annotation" inspection to be suppressed (IDEA-140503)
This commit is contained in:
+14
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2014 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2015 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.
|
||||
@@ -17,6 +17,7 @@ package com.siyeh.ig.maturity;
|
||||
|
||||
import com.intellij.codeInspection.BatchSuppressManager;
|
||||
import com.intellij.codeInspection.JavaSuppressionUtil;
|
||||
import com.intellij.codeInspection.SuppressQuickFix;
|
||||
import com.intellij.codeInspection.SuppressionUtilCore;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
@@ -26,6 +27,7 @@ import com.siyeh.ig.BaseInspection;
|
||||
import com.siyeh.ig.BaseInspectionVisitor;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -48,6 +50,17 @@ public class SuppressionAnnotationInspectionBase extends BaseInspection {
|
||||
"inspection.suppression.annotation.problem.descriptor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuppressedFor(@NotNull PsiElement element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SuppressQuickFix[] getBatchSuppressActions(@Nullable PsiElement element) {
|
||||
return SuppressQuickFix.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseInspectionVisitor buildVisitor() {
|
||||
return new SuppressionAnnotationVisitor();
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
<warning descr="Inspection suppression annotation '@SuppressWarnings({\\"ALL\\", \\"SuppressionAnnotation\\"})'">@SuppressWarnings({"ALL", "SuppressionAnnotation"})</warning>
|
||||
public class SuppressionAnnotation {
|
||||
|
||||
<warning descr="Inspection suppression annotation '@SuppressWarnings(\\"PublicField\\")'">@SuppressWarnings("PublicField")</warning>
|
||||
|
||||
Reference in New Issue
Block a user