EnhancedSwitchBackwardMigration: do not generate break if cannot may complete normally: IDEA-205607

This commit is contained in:
Roman.Ivanov
2019-02-11 10:26:46 +07:00
parent edb5e0f4ba
commit ba93dfaee9
3 changed files with 34 additions and 1 deletions
@@ -0,0 +1,16 @@
// "Replace with old style 'switch' statement" "true"
import java.util.*;
class X {
boolean x(int i) {
boolean b;
switch (i) {
case 2:
throw null;
default:
b = true;
break;
}
return b;
}
}
@@ -0,0 +1,13 @@
// "Replace with old style 'switch' statement" "true"
import java.util.*;
class X {
boolean x(int i) {
boolean b;
switch<caret> (i) {
case 2 -> throw null;
default -> b = true;
}
return b;
}
}