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
I noticed when working on jspecify/jspecify#678 that the Nullness Checker currently accepts @Nullable on the created array:
@Nullable
import org.checkerframework.checker.nullness.qual.Nullable; public class ADemo { void foo() { int [] o = new int @Nullable [10]; o.hashCode(); } }
An error is raised on the o.hashCode() even though that reference is intrinsically non-null.
o.hashCode()
Like for object creation, an array creation cannot be @Nullable. (Check other possible qualifiers, also initialization).
The text was updated successfully, but these errors were encountered:
@wmdietl I'm unable to reproduce the error raised on o.hashCode but will work on updating checker to not accept qualifier on array creation.
o.hashCode
Sorry, something went wrong.
Ah, I had used a 2 year old CF version... that produced:
> ./checker/bin/javac -processor nullness ADemo.java ADemo.java:6: error: [dereference.of.nullable] dereference of possibly-null reference o o.hashCode(); ^ 1 error
It doesn't really make sense, because the logic that makes array creations non-null has been there for a long while.
Let's just produce a warning that the @Nullable in the example is ignored.
thisisalexandercook
Successfully merging a pull request may close this issue.
I noticed when working on jspecify/jspecify#678 that the Nullness Checker currently accepts
@Nullable
on the created array:An error is raised on the
o.hashCode()
even though that reference is intrinsically non-null.Like for object creation, an array creation cannot be
@Nullable
. (Check other possible qualifiers, also initialization).The text was updated successfully, but these errors were encountered: