[java-intention] BreakConverter#process fixed

isRemovable must be called before any modifications. Otherwise, previous modifications may affect its results.

GitOrigin-RevId: d05be1e54ba62e5ac18003bf54dab2abb16124ce
This commit is contained in:
Tagir Valeev
2020-08-03 09:51:38 +00:00
committed by intellij-monorepo-bot
parent bd24e716a3
commit 9ca4341d7f
3 changed files with 46 additions and 5 deletions
@@ -0,0 +1,16 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int x) {
if (x > 0) {
if (x == 1) {
if (Math.random() > 0.5) {
System.out.println(1);
} else {
}
} else if (x == 2) {
System.out.println(2);
}
}
System.out.println("Exit");
}
}
@@ -0,0 +1,20 @@
// "Replace 'switch' with 'if'" "true"
class X {
void test(int x) {
if (x > 0) {
swi<caret>tch (x) {
case 1:
if (Math.random() > 0.5) {
System.out.println(1);
break;
} else {
break;
}
case 2:
System.out.println(2);
break;
}
}
System.out.println("Exit");
}
}