-
Couldn't load subscription status.
- Fork 381
Sound or unsound treatment of collection Object parameters; fixes #3040 #3063
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
Sound or unsound treatment of collection Object parameters; fixes #3040 #3063
Conversation
…eters-may-be-null-not-enabled into collection-object-parameters-may-be-null
…arameters-may-be-null
…arameters-may-be-null
…eters-may-be-null
…eters-may-be-null
…:mernst/checker-framework into collection-object-parameters-may-be-null
…eters-may-be-null
…eters-may-be-null
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 haven't yet looked at the latest changes to the astub file.
checker/jdk/nullness/src/java/util/concurrent/BlockingDeque.java
Outdated
Show resolved
Hide resolved
checker/jdk/nullness/src/java/util/concurrent/ConcurrentSkipListSet.java
Outdated
Show resolved
Hide resolved
...in/java/org/checkerframework/checker/nullness/collection-object-parameters-may-be-null.astub
Outdated
Show resolved
Hide resolved
...in/java/org/checkerframework/checker/nullness/collection-object-parameters-may-be-null.astub
Show resolved
Hide resolved
…eters-may-be-null
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.
Thanks for these improvements!
A few comments from a quick look through the changes. I didn't think through the specification details, though.
changelog.txt
Outdated
| -AuseDefaultsForUncheckedCode to -AuseConservativeDefaultsForUncheckedCode | ||
| The old name works temporarily but will be removed in a future release. | ||
|
|
||
| For collection methods with `Object` formal parameter type, such as contains, |
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.
Maybe add Nullness Checker: or something, to make it clear which checkers are affected by this.
| */ | ||
| @Pure | ||
| public int indexOf(@Nullable Object o) { | ||
| public int indexOf(@NonNull Object o) { |
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.
It's a bit odd that the @NonNull is made explicit here (and before in the wildcard bounds).
NonNull is the default here and not used for non-Object parameter types.
Do you want these explicit? If so, maybe add a note in the README about this convention?
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.
Note that you didn't make NonNull explicit in AbstractMap below...
| import java.util.Map; | ||
| import org.checkerframework.checker.initialization.qual.*; | ||
| import org.checkerframework.checker.nullness.qual.*; | ||
| import org.checkerframework.checker.regex.qual.*; |
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 import all these annotations, even though they aren't used?
Why not import @Pure, which is used?
| String line; | ||
| while ((line = reader.readLine()) != null) { | ||
| System.out.println(line); | ||
| try (InputStream in = getClass().getResourceAsStream("/git.properties")) { |
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 clear how this is related to this PR?
Parts of this are relevant to typetools/checker-framework#3197 Other parts are a followup to typetools/checker-framework#3063 Merge with typetools/checker-framework#3549
Merge together with typetools/jdk#34 and plume-lib/plume-util#50