Revised JEP: Null-Restricted Value Object Storage
Dan Smith
daniel.smith at oracle.com
Tue Mar 21 16:10:17 UTC 2023
I've updated JEP 401, formerly "Primitive Classes", now titled "Null-Restricted Value Object Storage". The purpose of this JEP is to allow for flattening of value objects in fields and arrays. This update gets there via two key features:
- "Optional" constructors, which express the capability of a value class to have instances created outside the normal construction process.
- Null-restricted types, which exclude null from the type's value set, and in the case of value classes with optional constructors, allow for a non-null default value.
There's more to say about nullness, which is covered by its own JEP that we're still working on. But the idea of null-restricted variables is enough to unblock progress on value object flattening. (Eventually, we envision—at least for now—delivering the two JEPs at the same time.)
The document is here:
https://openjdk.org/jeps/401
More information about the valhalla-spec-observers
mailing list