From 78f0732c4484d5e5cc2b918841567a1f690db4f8 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 5 Dec 2017 14:00:21 +0100 Subject: [PATCH] ignore INFORMATION level problems in batch --- .../intellij/codeInspection/OptionalIsPresentInspection.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/java-impl/src/com/intellij/codeInspection/OptionalIsPresentInspection.java b/java/java-impl/src/com/intellij/codeInspection/OptionalIsPresentInspection.java index 375781358b60..e72f641ea5fd 100644 --- a/java/java-impl/src/com/intellij/codeInspection/OptionalIsPresentInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/OptionalIsPresentInspection.java @@ -48,6 +48,9 @@ public class OptionalIsPresentInspection extends AbstractBaseJavaLocalInspection void registerProblem(@NotNull ProblemsHolder holder, @NotNull PsiExpression condition, OptionalIsPresentCase scenario) { if(this != NONE) { + if (this == INFO && !holder.isOnTheFly()) { + return; //don't register fixes in batch mode + } holder.registerProblem(condition, "Can be replaced with single expression in functional style", this == INFO ? ProblemHighlightType.INFORMATION : ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new OptionalIsPresentFix(scenario));