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 16:36:08 +03:00
parent 09aa5b41f8
commit ce236e3666
50 changed files with 594 additions and 87 deletions
@@ -0,0 +1,13 @@
// "Unwrap 'else' branch (changes semantics)" "true"
class T {
void f(boolean b) {
if (b) {
System.out.println("When true");
} <caret>else {
// Before
System.out.println("Otherwise");
// After
}
}
}