mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
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
22 lines
477 B
Java
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;
|
|
}
|
|
} |