Files
Tagir Valeevandintellij-monorepo-bot 4ef5b8a616 [java-dfa] Avoid referencing to the variables in array initializers.
Variables could change after array initialization even if the array itself is constant
IDEA-222152 Incorrect processing of array initializer when it uses a reassigned variable

GitOrigin-RevId: 5d21b222302b04ab7d24467d9b834b5763a73588
2021-05-13 11:39:21 +00:00

10 lines
265 B
Java

import org.jetbrains.annotations.*;
public class ArrayInitializerElementRewritten {
public static void main(String[] args) throws InterruptedException {
Object p = null;
Object[] ps = new Object[]{p};
p = new Object();
if (ps[0] == null) {}
}
}