mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 07:40:42 +07:00
ControlFlowAnalyzer: fix control flow for assert (IDEA-186305)
This commit is contained in:
+19
@@ -92,4 +92,23 @@ class T1 {
|
||||
(i4) = 1;
|
||||
(<error descr="Expression expected">)</error>++;
|
||||
}
|
||||
}
|
||||
class T3 {
|
||||
private final boolean b;
|
||||
{
|
||||
assert false : "" + (b = true); // if assignment reachable, assert will not complete normally
|
||||
b = true; // compiles
|
||||
System.out.println(b);
|
||||
}
|
||||
}
|
||||
class T3a {
|
||||
private final boolean b;
|
||||
{
|
||||
try {
|
||||
assert false : "" + (b = true);
|
||||
}
|
||||
catch(IllegalArgumentException t) {}
|
||||
<error descr="Variable 'b' might already have been assigned to">b</error> = true; // red
|
||||
System.out.println(b);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user