mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-22 00:19:11 +07:00
The annotation may differ, depending on library used. Also, it could be a container annotation like @NullMarked or @NotNullByDefault, so let's use more neutral wording GitOrigin-RevId: cb4923f5ec3974f56ec1b6763c2405c1471bf601
24 lines
641 B
Java
24 lines
641 B
Java
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 non-null variable">null</warning>;
|
|
}
|
|
|
|
@NotNull private volatile Object obj;
|
|
} |