Java: Don't offer "Unwrap 'else' branch" intention if it might cause unreachable code (IDEA-165428)

This commit is contained in:
Pavel Dolgov
2017-01-17 15:46:27 +03:00
parent 09aa5b41f8
commit ce236e3666
50 changed files with 594 additions and 87 deletions
@@ -0,0 +1,19 @@
// "Unwrap 'else' branch (changes semantics)" "true"
class T {
void f(boolean b, int n) {
switch (n) {
case 1:
if (b)
System.out.println("When true");
<caret>else {
// Before
System.out.println("Otherwise");
// After
return;
}
case 2:
}
System.out.println("Done");
}
}