* some-java-user:

> However, neither the static fields are `volatile` nor are the getter
> methods synchronized. So if my understanding of the Java Memory
> Model is correct, the compiler is free to reorder the two static
> field reads. So it is in theory possible that the first read yields
> a non-`null` value, but the second read yields a `null` value which
> leads to incorrect behavior (for further reading [1]).

> [1] 
> https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/#wishful-benign-is-resilient

Can the JVM be multi-threaded at this point?  If not, program order
results in the desired behavior.

Reply via email to