Skip to content

Comment on JEP 539: Strict Field Initialization in the JVM moved to previewparent

Comments

I believe these 2 are effectively linked.

There's a jdk.internal API which will work as an escape hatch, but that does come with the need for non-compliant libraries to switch over to it. That safety hatch also only allows the setting of final fields once before observation (which is generally fine). So if your code is doing something more esoteric that sets a final field multiple times you will be SOL.

In any case, if you are using the sun.misc.Unsafe methods for setting final and private fields you'll need to update.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.