Question -- Are null-restricted arrays a possible future?

Brian Goetz brian.goetz at oracle.com
Sun Jan 14 14:15:48 UTC 2024


That would fall into the category of “more general support for nullness features.”  Arrays are reference types.  This JEP starts deliberately narrowly — with value types.

On Jan 12, 2024, at 7:54 PM, David Alayachew <davidalayachew at gmail.com<mailto:davidalayachew at gmail.com>> wrote:

Hello Valhalla Dev Team,

I see the JEP Draft for Null-Restricted Value Class Types (https://openjdk.org/jeps/8316779), and it looks beautiful. I am extremely excited at the possibilities.

At the very bottom of the draft, there is a tiny snippet --- "More general support for nullness features will be explored in a future JEP."

Any chance that we could be looking at arrays that cannot be null?

And to be clear, I am not saying arrays that cannot contain null. This JEP Draft already confirms that that is not only a possibility, but might very well become reality (only if this draft goes live, and then the feature exits preview into GA).

No, I mean that the array itself cannot be null. Any possibility? And apologies if the answer is obvious. I don't want to make any assumptions here, since I am still wrapping my mind around how Valhalla made all of this stuff possible. I figured it's better to just ask.

Thank you for your time and help!
David Alayachew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20240114/bfdf3f0c/attachment.htm>


More information about the valhalla-dev mailing list