volatile field's nullity shouldn't be used for dfa (IDEA-64696)

This commit is contained in:
peter
2011-01-27 19:36:59 +01:00
parent f9ae15b894
commit 6c8b65e4cd
4 changed files with 55 additions and 1 deletions
@@ -0,0 +1,24 @@
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
class Test {
public void setObj(Object obj) {
this.obj = obj;
}
public void test() {
obj = new Object();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Object o = obj;
if (<warning descr="Condition 'o != null' is always 'true'">o != null</warning>) {
System.out.println("x");
}
}
});
obj = <warning descr="'null' is assigned to a variable that is annotated with @NotNull">null</warning>;
}
@NotNull private volatile Object obj;
}