RFR: 8372696: Allow boot classes to explicitly opt-in for final field trusting [v7]

Chen Liang liach at openjdk.org
Thu Dec 18 16:28:36 UTC 2025


On Thu, 18 Dec 2025 04:58:38 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> So my question is why this annotation does not try to enforce a stronger invariant so that we can benefit from those invariants without having to wait for strict fields.

No. We currently cannot enforce such final fields to be all written before the `Object::<init>` entry, and I also don't think mainline has this safe publication fence at the beginning of `Object::<init>` either.

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

PR Comment: https://git.openjdk.org/jdk/pull/28540#issuecomment-3671092060


More information about the core-libs-dev mailing list