ignore INFORMATION level problems in batch

This commit is contained in:
Anna.Kozlova
2017-12-05 14:04:11 +01:00
parent 36ef3bc714
commit 78f0732c44
@@ -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));