-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flip the safety restrictions from 3rd party jars. #1119
Comments
Hi @xenoterracide,
We haven't had a request for finer-grained control like that before. Do you have examples of jars with incorrect
This indeed would be safer. We never added this option since we thought it would add way too much noise. The Checker Framework, which strives for soundness, has an option to treat libraries in this way, but they disable it by default, presumably for the same reason. Maybe you can share more details on what you are trying to accomplish? If you are trying to obtain very strong guarantees about the null safety of your code, to be 100% honest NullAway may not be the best option, as there are a number of ways that it can miss possible NPEs. (See Section 4 and Section 6 of this paper for some details / examples.) You might instead want to use the Checker Framework Nullness Checker with the option linked above set to treat libraries conservatively. If you'd like jgit to be annotated for nullness, maybe we can work with the project authors on that, using the NullAway Annotator to help. |
not incorrect, jgit is just incomplete. However, in its case its safer to assume that input must not be null, and output is nullable. AFAIK I have no other mixed libraries. They are all either fully annotated, or not annotated at all. I would think it would be more performant (not that I'm having a performance issue) to tell the system to only look for individual annotations in jgit packages; not just every library marked as unknown.
which I feel like it makes sense for adding this to a large-ish project that has much library usage. However, in a greenfield where you can handle as they come. I've kind of re-thought this a bit, thinking of apache commons lang3. It might be nicer to be able to change the defaults easily per package. Since commons lang3 is basically known to allow nullable inputs, but also have nullable outputs. Where perhaps we could just set a list of packages with default nullable input and another list with default nullable output. Of course how this impacts.
every time I've tried I've found it obnoxious in other ways. I'm not certain I want/need 100% comprehensiveness.
I opened a ticket for that eclipse-jgit/jgit#121 note: somewhere there's a ticket for apache commons to be annotated, but they haven't been willing yet. I don't know if jspecify has ever been mentioned on that ticket. |
I guess this is two related requests?
https://github.com/uber/NullAway/wiki/Configuration#acknowledge-more-restrictive-annotations-from-third-party-jars
First, a question, this is a boolean, how does this help when this is a problem with only one jar (looking at you jgit!) feels like it should take packages like other options.
Secondly, can we get an option to flip this? which seems more safe to me. The new option would be worded as follows.
I personally feel this would be safer.
The text was updated successfully, but these errors were encountered: