Re:JEP 401: Value Objects (Preview) merged to OpenJDK master
by DarkNova6 on Monday August 03, 2026 @09:23AM
(#49155505)
I think it keeps going back to "preserving type invariants". Turning an object into a value can have surprising constraints on the integrity of the type. These include: forced empty constructor (for bulk initialiation in arrays), violation of cross-field invariance (think of a Range-type where "end" value is suddenly smaller than the "start" due to a data race), etc.
Java always had a focus on enabling library authors over empowering call-site users. And I think approach has proven its dividend.
Java always had a focus on enabling library authors over empowering call-site users. And I think approach has proven its dividend.