On Tue, 23 Feb 2021 13:23:44 GMT, Andrey Turbanov 
<github.com+741251+turban...@openjdk.org> wrote:

> Avoid double-read non volatile static field

This shouldn't be a problem. Version is a pojo and value based, and the 
computed result may be different instances but would return `true` for `equals` 
and should have no problems

src/java.base/share/classes/java/lang/Runtime.java line 824:

> 822:                     VersionProps.pre(), VersionProps.build(),
> 823:                     VersionProps.optional());
> 824:             version = v;

Can't this just be `return version = new Version(...` than reassigning to a 
local variable for no good?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2691

Reply via email to