IDEA-235649 'Unwrap if statement' of 'if' statement inside 'case' statement removes subsequent 'case' statements

GitOrigin-RevId: 16a50c6f792fb2d30956e72fdcaaca3ed2d5b985
This commit is contained in:
Tagir Valeev
2020-03-23 05:04:23 +00:00
committed by intellij-monorepo-bot
parent d84fd8b7dd
commit 32967db59d
4 changed files with 46 additions and 2 deletions
@@ -0,0 +1,15 @@
// "Unwrap 'if' statement" "true"
class X {
public String testUnwrap(String f) {
switch (f) {
case "A":
return "A";
case "B":
return "b";
case "D":
return "D";
default:
return null;
}
}
}
@@ -0,0 +1,18 @@
// "Unwrap 'if' statement" "true"
class X {
public String testUnwrap(String f) {
switch (f) {
case "A":
return "A";
case "B":
if (t<caret>rue) {
return "b";
}
return "B";
case "D":
return "D";
default:
return null;
}
}
}