Java control flow: Fixed false positive for definite assignment in finally block - more lightweight implementation (IDEA-64488)

This commit is contained in:
Pavel Dolgov
2016-08-03 12:47:42 +03:00
parent 984b17e047
commit d92688892f
2 changed files with 116 additions and 25 deletions
@@ -467,4 +467,25 @@ class ContinueFromTry {
<error descr="Unreachable statement">System.out.println();</error>
}
}
}
class ManyExitsFromTry {
void f() {
final int i;
outer:
{
while (true) {
<error descr="Variable 'i' might be assigned in loop">i</error> = 1;
try {
if (i > 1) continue;
if (i > 2) break;
if (i > 3) break outer;
if (i > 4) return;
if (i > 5) throw new RuntimeException();
}
finally {
}
}
}
}
}