Skip to content- Sources: primary, primary, discussion
- Thread: JDK 28 and JEP 401 Value Objects preview
- Summary: JEP 401 is marked Integrated for release 28. It adds a value modifier for classes and records that are immutable and have no identity, and == compares their field values. With --enable-preview, 30 platform classes, including the boxed primitives, Optional, and several java.time types, become value classes, and synchronizing on them throws IdentityException.
- Why it matters: Code that synchronizes on boxed primitives or java.time objects, or relies on == identity for them, will break under preview, so test it against JDK 28 early-access builds now.
- Follow-up: JDK 28 rampdown schedule and early-access builds with value class support.