mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspections] EA-838138, Fix empty cases
GitOrigin-RevId: b45993878b906f3a5209ad0b968b43f8d872dbbf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
699b5fd32c
commit
63396759c4
+2
-1
@@ -582,7 +582,8 @@ public class EnhancedSwitchMigrationInspection extends AbstractBaseJavaLocalInsp
|
||||
OldSwitchStatementBranch branch = branches.get(i);
|
||||
if (!isConvertibleBranch(branch, i != size - 1)) return null;
|
||||
PsiStatement[] statements = branch.getStatements();
|
||||
if (branch.isFallthrough() || statements.length == 0) continue;
|
||||
if (branch.isFallthrough() && statements.length == 0) continue;
|
||||
if (statements.length == 0) return null;
|
||||
if (statements.length > maxNumberStatementsForExpression) {
|
||||
isInfo = true;
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with 'switch' expression" "false"
|
||||
|
||||
public class EnhancedSwitchIntentionBug {
|
||||
public static void main(String[] args) {
|
||||
int x;
|
||||
switch<caret> (args[0]) {
|
||||
case "1":
|
||||
case "2":
|
||||
case "3":
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user