Updated specs for Value Classes

Dan Smith daniel.smith at oracle.com
Wed Dec 10 16:09:39 UTC 2025


Just a note that I've cleaned up some of the JLS rules regarding field accesses in early construction. Update posted here:

https://cr.openjdk.org/~dlsmith/jep401/jep401-20251210/specs/value-objects-jls.html<https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jls.html>

On Sep 26, 2025, at 3:57 PM, Dan Smith <daniel.smith at oracle.com> wrote:

Please see these spec change documents, revised to align with current plans for the Value Classes and Objects JEP.

https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jls.html
https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jvms.html

I've also revised the JEP in the last couple of months, which you can view here:

https://openjdk.org/jeps/401

Some highlights:

- Clarified the presentation of how == works, with extensive discussion in the JEP
- Instance fields can be both written and read in early construction
- Record classes adopt the same early construction behavior as value classes
- Memory model rules to ensure correct values are read from value and record class fields (and, eventually, other strict fields)
- New verifier rules disallowing acmp/ifnull on uninitialized types

A linked JVMS document covers the Strict Field Initialization JEP, although I still have some work to do to refresh and polish that one.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20251210/ff7f2f76/attachment.htm>


More information about the valhalla-spec-observers mailing list