Skip to content

Flip the safety restrictions from 3rd party jars. #1119

Open
@xenoterracide

Description

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.

For example, when this flag is turned on, a method Object foo(Object o) in an unannotated package would be assumed to not take a nullable argument and return a nullable. However, a method Object bar(@Nullable Object o) will be interpreted by NullAway as taking a nullable argument, and a method @NonNull Object baz(Object o) will be acknowledged as not returning a null, even in code otherwise marked as unannotated. If this flag is turned off, which is the default, all three examples are treated as the first and optimistic defaults are assumed to reduce the number of warnings unless the package is marked as fully annotated.

I personally feel this would be safer.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions