mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-06 01:06:54 +07:00
Fixes IDEA-293687 Incorrectly claims "expression is always false" GitOrigin-RevId: 74a3d8f7b3b0a66a974aa35d55147cbc3336393f
25 lines
564 B
Java
25 lines
564 B
Java
// IDEA-293687
|
|
public class FieldUpdateViaSetter {
|
|
private static final MutableBoolean flag = new MutableBoolean();
|
|
|
|
public static void main(String[] args) {
|
|
for (int i = 0; i < 10; ++i) {
|
|
if (flag.value && i == 0) {
|
|
break;
|
|
}
|
|
if (flag.value && i == 3) {
|
|
System.out.println("IDEA thinks we can't get here");
|
|
break;
|
|
}
|
|
flag.setValue(true);
|
|
}
|
|
}
|
|
|
|
private static final class MutableBoolean {
|
|
private boolean value;
|
|
|
|
public void setValue(boolean newValue) {
|
|
value = newValue;
|
|
}
|
|
}
|
|
} |