Files
Tagir Valeevandintellij-monorepo-bot e9950c0327 [java-dfa] Remove equivalences when flushing qualified methods
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
2022-04-29 12:50:06 +00:00

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;
}
}
}