IDEA-200030 Quick-fix to remove unreachable should remove body only if previous branch has 'break' at the end

This commit is contained in:
Tagir Valeev
2018-10-08 10:57:50 +07:00
parent 5be3af93e0
commit 5663e0bde8
3 changed files with 31 additions and 1 deletions
@@ -0,0 +1,15 @@
// "Remove switch label '"two"'" "true"
class Main {
static void fff() {
switch ("one") {
case "one":
System.out.println("one");
// quick-fix removes body as well
System.out.println("two");
}
}
public static void main(String[] args) {
fff();
}
}
@@ -0,0 +1,15 @@
// "Remove switch label '"two"'" "true"
class Main {
static void fff() {
switch ("one") {
case "one":
System.out.println("one");
case "<caret>two": // quick-fix removes body as well
System.out.println("two");
}
}
public static void main(String[] args) {
fff();
}
}