guava
guava copied to clipboard
Add some annotations from "On Leveraging Tests to Infer Nullable Annotations" data
After a conversation with @jensdietrich in an Error Prone issue, Jens provided us with some data on Guava fields, parameters, and method returns that see null values during the course of testing (aside from tests that are checking that NPE occurs :)). That comes from the paper in the title:
Jens Dietrich, David Pearce and Mahin Chandramohan: On Leveraging Tests to Infer Nullable Annotations. ECOOP’23.
I've looked at the data for a few classes already and submitted some changes:
ClassToInstanceMapandTypeToInstanceMaphad previously had non-nullable types because we were limiting which annotations we used.MapMakerInternalMapwas missing many annotations (and is very likely still be missing a few) because we hadn't tried to annotate it.MoreObjects.firstNonNullwas missing a nullness annotation, and the data did not show that because it turned out that we'd never tested the case or even open-sourced the tests that we did have.
I may try to incorporate some more annotations in the future, but that's the story so far.