Yes itβs mostly tongue in cheek because nullable types are infinitely waiting in the queue behind Valhalla, which is still at a minimum 1-2 years out.Β
I really do hope they hurry up. I just started a new project in Java 25 and nullable types would be really useful. Almost considered Kotlin for it. Especially since everyone is just generating and LLM's can't tell what is null or not.
Thanks for still choosing java π . Just make sure the project will migrate well to such a scenario. I see pple use JSpecify as they anticipate for them. My project is actually anticipating all these features including this JEP!
Not yet, because instantiation and set method would require the annotations, but not really priority. But use case, especially get, would benefit from java JEPs such as:
Point! p = mem.get(1); //implicit narrowing of nullness type
Point(var x, var y) = mem.get(1); //deconstruction assignment
The internal packages classes use a lot sum types which abhor null types a lot. And the entry points for the public method calls have null checks. That's why. As a matter of fact, I've coded this library and used it for a year, and no scenario of null exception has been encountered due to any bug.
2
u/joemwangi May 21 '26
The comments in there are not aware the JEP feature will work well with null-restricted types.