-
Notifications
You must be signed in to change notification settings - Fork 227
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
More nullability annotation work #70
Conversation
This is a followup to #69, and improves it in two main ways: - This adds it to subpackages as well, which I missed in the first pass. - Switches to a custom `PackageNonNull` annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly.
@@ -0,0 +1,3 @@ | |||
POM_NAME=AutoDispose (Provided) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we shipping this to maven? this is compileOnly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs to be available in sources jar for static analysis right?
LGTM. But unless you have public fields, the main change here is that the annotation means return types are |
the annotation applies to parameters, method return types, and fields in general, even private ones (though those only really matter for internal details) |
ElementType.METHOD, | ||
ElementType.PARAMETER | ||
}) | ||
@Retention(RetentionPolicy.RUNTIME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SOURCE retention please. Since this is not really shipped out to consumers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I coped this from @ParametersAreNonnullByDefault
, let me see if I can find the justification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary, we'll make this a separate project later
This is a followup to #69, and improves it in two main ways:
PackageNonNull
annotation instead, which expands the checks to also include return types, fields, local vars, etc. It's pretty broad right now but we could reduce scope if need be. This is pulled into a separate artifact for re-use, but still only applied as compileOnly.@ParametersAreNonnullByDefault
actually only covers method parameters it seems.