JEP 539: Strict Field Initialization in the JVM moved to preview

openjdk.org

53 points by za3faran 6 hours ago


exabrial - 35 minutes ago

This a much needed change. Glad to see it! Might be some headaches in the short term, but thats ok.

- 4 hours ago
[deleted]
cogman10 - 5 hours ago

This is a great change that will undoubtedly cause a lot of headaches.

There's a number of libraries (particularly around serialization/marshaling) which will end up mutating `final` fields. In fact, this is a trick I've pulled once or twice in my own code for "reasons" (generally needing to modify behavior of a library because it was deficient).

I suspect this will be one of those things that ends up requiring java devs everywhere to bump up the versions of the libraries they use.

joe_mwangi - 4 hours ago

Also, this will be used for future null-restricted types.

rvcdbn - 4 hours ago

oracle planning a new jvm language? have we ever seen a feature like this that is explicitly not usable from Java?