Files
Tagir Valeevandintellij-monorepo-bot 31e7834867 [java-dfa] Use temp variables when evaluating contracts
Fixes IDEA-275334 Contract is not properly evaluated when it refers to non-variable value

GitOrigin-RevId: 4f507cbf602b186eb896f50fb8007d8d8ad75f45
2021-08-06 09:36:44 +00:00

10 lines
331 B
Java

class X {
native int getValue(int x);
void test() {
int result = Math.max(1, getValue(0));
int result2 = Math.max(getValue(0), 1);
if (<warning descr="Condition 'result > 0' is always 'true'">result > 0</warning>) {}
if (<warning descr="Condition 'result2 > 0' is always 'true'">result2 > 0</warning>) {}
}
}