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));