Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/PureMethodReadsMutableArray.java
Tagir Valeev 010294e044 [java-dfa] More aggressive flushing of calls
Pure call result might depend on non-qualified variable as well (e.g., a static field)
Fixes IDEA-286208 wrong judgement of code

GitOrigin-RevId: 91ce214a1bc75bad64b344f332e85574fba25ca6
2022-01-11 09:28:40 +00:00

27 lines
520 B
Java

// IDEA-286208
public class PureMethodReadsMutableArray {
static char[] dic = new char[128], cnt = new char[128];
public static void main(String[] args) {
if (check()) {
cnt[0]=1;
if (check()) {}
}
if (check()) {
cnt[args.length]=1;
if (check()) {}
}
if (check()) {
cnt[0]++;
if (check()) {}
}
}
public static boolean check() {
for (int i = 0; i < 128; i++) {
if (dic[i] > cnt[i]) {
return false;
}
}
return true;
}
}