mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
synchronized block start should really flush fields
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
public class Bar {
|
||||
private Object field;
|
||||
private final Object lock = new Object();
|
||||
|
||||
public void main() {
|
||||
synchronized (lock) {
|
||||
if (field != null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
synchronized (lock) {
|
||||
if (field != null) {
|
||||
return;
|
||||
}
|
||||
if (<warning descr="Condition 'field == null' is always 'true'">field == null</warning>) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user