Project Valhalla will go into Java 28 (next year, and preview version).
Fingers crossed I'll manage to use null type safety in my lifetime.
universal null type safety has sadly been discarded as a core concept of Valhalla in my Understanding; that being said, the proposals in Valhalla have null-safety as a side effect, but only under certain conditions.
NullAway with JSpecify annotations are a really good way to add null safety to Java applications. Even enforces nullability at the generic level.
You really need to dare to try something else, Kotlin has been available for many years and the cost for a Java shop is super small since the same tools work with both. I’ve used also Dart which is lots of fun. Even Typescript can be a good alternative depending on what you’re doing. All have nullability guarantees and a nicer type system than Java while being in the same ballpark in terms of performance.
A first step of Valhalla that is ...
> Project Valhalla will go into Java 28
Unfortunatley without specialized generics and without the performance benefits that are supposed to come with it. They were too slow with Valhalla.