Files
Tagir Valeev fe8e2f8122 [java-analysis] Pop jump roles and statements right after the condition
They should not take effect when we are already at branches.
Fixes IDEA-292666 False negative for checking definite assignment with ternaries

GitOrigin-RevId: 991562f8ec5a9c7b33dfa6a1810bb4ac385c7209
2022-04-26 16:34:34 +00:00

10 lines
268 B
Java

class X {
void test(int a, int b, int c){
int x;
if((a > 0? c < b && (x = b) > 0: (x = c) < 0 || c == b)) {
System.out.println(x);
} else {
System.out.println(<error descr="Variable 'x' might not have been initialized">x</error>);
}
}
}