diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforePublicClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforePublicClass.java new file mode 100644 index 000000000000..32442ea362b4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantUncheckedVarargs/beforePublicClass.java @@ -0,0 +1,4 @@ +// "Remove 'WeakerAccess' suppression" "false" +@SuppressWarnings("WeakerAccess") +public class beforePublicClass { +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/RemoveRedundantSuppressionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/RemoveRedundantSuppressionTest.java index fb0fd9ebf43f..5053fda5e8ab 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/RemoveRedundantSuppressionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/RemoveRedundantSuppressionTest.java @@ -8,6 +8,7 @@ import com.intellij.codeInspection.RedundantLambdaCodeBlockInspection; import com.intellij.codeInspection.RedundantSuppressInspection; import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection; +import com.intellij.codeInspection.visibility.VisibilityInspection; import com.intellij.psi.impl.source.tree.injected.MyTestInjector; import com.siyeh.ig.controlflow.FallthruInSwitchStatementInspection; import com.siyeh.ig.inheritance.RefusedBequestInspection; @@ -33,6 +34,7 @@ public class RemoveRedundantSuppressionTest extends LightQuickFixParameterizedTe new FallthruInSwitchStatementInspection(), new UnusedDeclarationInspection(true), new RedundantLambdaCodeBlockInspection(), + new VisibilityInspection(), new AutoBoxingInspection(), new RefusedBequestInspection()); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java index e61d598ff641..72d52a65b69a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java @@ -222,7 +222,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass } Set activeTools = new HashSet<>(); for (LocalInspectionToolWrapper tool : toolWrappers) { - if (tool.isUnfair() || !tool.isApplicable(fileLanguage)) { + if (tool.isUnfair() || !tool.isApplicable(fileLanguage) || myProfileWrapper.getInspectionTool(tool.getShortName(), myFile) instanceof GlobalInspectionToolWrapper) { continue; } activeTools.add(tool.getID());