logoalt Hacker News

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

58 pointsby za3faranyesterday at 6:56 PM17 commentsview on HN

Comments

cogman10yesterday at 7:56 PM

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.

show 3 replies
exabrialtoday at 12:05 AM

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

joe_mwangiyesterday at 9:01 PM

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

rvcdbnyesterday at 8:13 PM

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

show 4 replies