ConvertSwitchToIfIntention: fix processing of empty blocks

IDEA-205137 `Replace Switch with If` produce exceptions
IDEA-205122 Unwrap switch fails with exception
This commit is contained in:
Tagir Valeev
2019-01-10 12:40:04 +07:00
parent 107adb48ab
commit 0835bd0976
6 changed files with 39 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void m() {
if (0 == 1) {
}
}
}

View File

@@ -0,0 +1,11 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void m() {
switc<caret>h (0) {
case 1 -> {
}
default -> {}
}
}
}