From 64cb6979cacec641086e01d3bb7e652fc162ec6b Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 20 Oct 2020 12:24:21 +0200 Subject: [PATCH] redundant suppression: don't warn on "all" locally as global tools are not run (IDEA-253244) GitOrigin-RevId: 3666dcf887e8a4735dee08f16e172c9272bfca24 --- .../quickFix/redundantUncheckedVarargs/beforeALL.java | 2 +- .../codeInspection/RedundantSuppressInspection.java | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforeALL.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforeALL.java index 04cf667512b2..af8c410bccd0 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforeALL.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforeALL.java @@ -1,4 +1,4 @@ -// "Remove 'ALL' suppression" "true" +// "Remove 'ALL' suppression" "false" import java.util.*; @SuppressWarnings({"ALL"}) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/RedundantSuppressInspection.java b/platform/lang-impl/src/com/intellij/codeInspection/RedundantSuppressInspection.java index 95d31b4d1924..cea375bb2e99 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/RedundantSuppressInspection.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/RedundantSuppressInspection.java @@ -9,7 +9,6 @@ import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; import com.intellij.lang.Language; import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.WriteExternalException; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; @@ -335,16 +334,6 @@ public class RedundantSuppressInspection extends GlobalSimpleInspectionTool { HashMap> scopes = new HashMap<>(); boolean suppressAll = collectSuppressions(element, scopes, IGNORE_ALL, mySuppressor); if (suppressAll) { - for (String suppressId : myActiveTools) { - if (isSuppressedFor(element, suppressId, myToolToSuppressScopes.get(suppressId))) { - return; - } - } - TextRange range = mySuppressor.getHighlightingRange(element, SuppressionUtil.ALL); - String allSuppression = range.substring(element.getText()); - holder.registerProblem(element, range, - InspectionsBundle.message("inspection.redundant.suppression.description"), - mySuppressor.createRemoveRedundantSuppressionFix(allSuppression)); return; } Collection suppressIds = scopes.get(element);