mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-06-14 15:36:27 +07:00
Java: Don't offer "Unwrap 'else' branch" intention if it might cause unreachable code (IDEA-165428)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user