mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
Java control flow: Fixed false positive for definite assignment in finally block - more lightweight implementation (IDEA-64488)
This commit is contained in:
+21
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user