Skip to content- Sources: primary
- Thread: JDK 28 and JEP 401 Value Objects preview
- Summary: The OpenJDK Quality Group's heads-up says JEP 401 makes 30 JDK classes, including the primitive wrappers, Optional and most java.time types, value classes when previews are enabled, even for code compiled earlier. Monitor use, java.lang.ref APIs and WeakHashMap throw IdentityException on value objects. Compiling records with previews enabled runs record constructors in early construction, so statements that touch this become compile errors.
- Why it matters: Libraries that synchronize on boxed values, key weak maps by them, or call instance methods in record constructors should add a JDK 28 preview-enabled CI job now.