r/java • • Aug 12 '24

JSpecify 1.0.0 and Nullability in Java

https://www.infoq.com/news/2024/08/jspecify-java-nullability/
52 Upvotes

33 comments sorted by

View all comments

26

u/syneil86 Aug 12 '24

There is currently a draft JEP trying to address this in the language itself, but I'm very glad that the community is trying to address the nullability issue themselves in the meanwhile

https://openjdk.org/jeps/8316779

2

u/trustin Aug 12 '24

It'd be awesome if @Nullable, @NullMarked, etc are also accepted as a part of the language because otherwise we will have to append ! pretty much everywhere.

4

u/erinaceus_ Aug 12 '24 edited Aug 12 '24

otherwise we will have to append ! pretty much everywhere.

I'm hoping that we'll some day be able to specify the default on a per-module basis, meaning that each module can decide for its own code, while dependent libraries can do the same for their own code (or just stick with the backwards compatible language-level default).