From 27fd02ec569d6d1edf9a99b83e0ffd8133cb2def Mon Sep 17 00:00:00 2001 From: Roman Ivanov Date: Mon, 7 Jun 2021 11:16:05 +0200 Subject: [PATCH] EnhancedSwitchMigrationInspection: do not show info level in batch: EA-267690 GitOrigin-RevId: 4a4e17c83e1fd37bdfd6369685033de6fa8ad065 --- .../codeInspection/EnhancedSwitchMigrationInspection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/EnhancedSwitchMigrationInspection.java b/java/java-impl/src/com/intellij/codeInspection/EnhancedSwitchMigrationInspection.java index 38d1dc549f13..7d944fdfaa80 100644 --- a/java/java-impl/src/com/intellij/codeInspection/EnhancedSwitchMigrationInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/EnhancedSwitchMigrationInspection.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInspection; import com.intellij.codeInsight.BlockUtils; @@ -53,6 +53,7 @@ public class EnhancedSwitchMigrationInspection extends AbstractBaseJavaLocalInsp ProblemHighlightType type = myWarnOnlyOnExpressionConversion && replacer.getType() == ReplacementType.Statement ? ProblemHighlightType.INFORMATION : ProblemHighlightType.GENERIC_ERROR_OR_WARNING; + if (!holder.isOnTheFly() && type == ProblemHighlightType.INFORMATION) return; List fixes = new ArrayList<>(); fixes.add(new ReplaceWithSwitchExpressionFix(replacer.getType())); if (!myWarnOnlyOnExpressionConversion && replacer.getType() == ReplacementType.Statement) {