Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convertSwitchToIf/afterBreakWithLabel.java
Tagir Valeev 1b4e5c1e39 Merge SwitchStatementWithSingleDefaultInspection into SwitchStatementWithTooFewBranches
Fixes IDEA-199499 Improve "Replace 'switch' with 'if'" action and make it a quick-fix for "Switch has too few branches"
Now default is not counted as branch in SwitchStatementWithTooFewBranches
2018-09-26 17:06:07 +07:00

22 lines
477 B
Java

// "Replace 'switch' with 'if'" "true"
class X {
int m(String s, int x) {
if (x > 0) {
SWITCH:
{
if ("a".equals(s)) {
System.out.println("a");
for (int i = 0; i < 10; i++) {
System.out.println(i);
if (i == x) return 0;
if (i == x * 2) break;
}
}
System.out.println("d");
}
} else {
return 1;
}
return 0;
}
}