mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
Fixes IDEA-292808 False positive for "Constant conditions and exceptions": always false IF condition in inner class with use of public method GitOrigin-RevId: b8235e443ecdb9c4a37b4c16b8814e48b607a2d3
24 lines
602 B
Java
24 lines
602 B
Java
// IDEA-292808
|
|
class Test {
|
|
private class Inner {
|
|
private boolean firstCheckOk;
|
|
private boolean secondCheckOk;
|
|
public void firstCheck(boolean ok) {
|
|
boolean oldOk = isOk();
|
|
this.firstCheckOk = ok;
|
|
boolean newOk = isOk();
|
|
if (oldOk != newOk)
|
|
System.out.println(newOk);
|
|
}
|
|
public void secondCheck(boolean ok) {
|
|
boolean oldOk = isOk();
|
|
this.secondCheckOk = ok;
|
|
boolean newOk = isOk();
|
|
if (oldOk != newOk)
|
|
System.out.println(newOk);
|
|
}
|
|
public boolean isOk() {
|
|
return firstCheckOk || secondCheckOk;
|
|
}
|
|
}
|
|
} |