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,15 @@
// "Unwrap 'else' branch (changes semantics)" "true"
class T {
void f(boolean b) {
try {
if (b)
System.out.println("When true");
<caret>else {
throw new RuntimeException("Otherwise");
}
} finally {
System.out.println("Finally");
}
}
}