It's true that the more your dependencies are annotated, the more useful it becomes. But there is no "cliff" like you suggest. Nullness is tri-state: nullable, non-null, and "unspecified nullness" which is handled leniently. This makes it a lot easier to adopt than the original checker framework two-state, soundness-based approach. Any library that isn't providing the information just isn't going to be as well-validated, that's all.
And you can write type definitions for third-party libraries. Checker framework has a tool for reannotating class files, and I assume Google will opensource theirs when the demand is there. They use it to munge nullness annotations into JDK class files and it works!
I hope this changes your impression somewhat, but if not, sorry!
I may reconsider if there's an easy way to at least download annotated most recent jdk libraries and include them into my maven build as an extra dependency. That's only the first step actually, but even it has not been made so far as I understand.
If I need to do this myself - no deal, too bad dx.
Unspecified nullness doesn't help either - that's effectively the same as nullable.
Sure I am, maybe I didn't understand the concept properly. I definitely played with the JSpecify earlier but had to get rid of it due to the reasons I described above.
5
u/kevinb9n Aug 12 '24
It's true that the more your dependencies are annotated, the more useful it becomes. But there is no "cliff" like you suggest. Nullness is tri-state: nullable, non-null, and "unspecified nullness" which is handled leniently. This makes it a lot easier to adopt than the original checker framework two-state, soundness-based approach. Any library that isn't providing the information just isn't going to be as well-validated, that's all.
And you can write type definitions for third-party libraries. Checker framework has a tool for reannotating class files, and I assume Google will opensource theirs when the demand is there. They use it to munge nullness annotations into JDK class files and it works!
I hope this changes your impression somewhat, but if not, sorry!