We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
instanceof @Nullable C
instanceof is only true for a non-null expression https://docs.oracle.com/javase/specs/jls/se13/html/jls-15.html#jls-15.20.2.
instanceof
Code like this:
if (nbl instanceof @Nullable C)
is misleading: the then-branch is not taken for a null value.
A @Nullable annotation on the type of an instanceof should raise an error. Having a @NonNull annotation is redundant, and could cause a warning.
@Nullable
@NonNull
The text was updated successfully, but these errors were encountered:
Related issue: #762
Sorry, something went wrong.
Validate instanceof types (#3481)
22d0286
Also, refine the expression of an `instanceof` if the reference type has an explicit annotation. (Fixes #3033 and fixes #762.)
aditya3434
Successfully merging a pull request may close this issue.
instanceof
is only true for a non-null expression https://docs.oracle.com/javase/specs/jls/se13/html/jls-15.html#jls-15.20.2.Code like this:
is misleading: the then-branch is not taken for a null value.
A
@Nullable
annotation on the type of aninstanceof
should raise an error.Having a
@NonNull
annotation is redundant, and could cause a warning.The text was updated successfully, but these errors were encountered: