Repository navigation
Conversation
…work and Kotlin do. In contrast, for _`computeIfAbsent`_, I've kept the signature _without_ `@Nullable` on the function result type and method return type. This is far more convenient for most callers, and it just might not cause problems for anyone: Callers of `computeIfAbsent` might _always_ provide a function that elects to insert a value (as expressed by returning a non-null value). I think this gives us the signatures that we'll want for the long term for `Map`, though of course we'd revisit if we chose to include `@PolyNull`. Previously: - #14 (comment) - #19 (comment) Note that this PR excludes `java.util.Properties` because there are a number of other changes that I'm going to make to it (and then upstream).
cpovirk
added a commit
that referenced
this pull request
Aug 15, 2023
I found my way to those classes as part of #32, but then I found other things that looked wrong, even though the classes are annotated with `@NullMarked.`
wmdietl
approved these changes
Aug 21, 2023
wmdietl
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, looks consistent to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In contrast, for
computeIfAbsent, I've kept the signature without@Nullableon the function result type and method return type. This isfar more convenient for most callers, and it just might not cause
problems for anyone: Callers of
computeIfAbsentmight always providea function that elects to insert a value (as expressed by returning a
non-null value).
I think this gives us the signatures that we'll want for the long term
for
Map, though of course we'd revisit if we chose to include@PolyNull.Previously:
Map.mergeannotations. #14 (comment)ConcurrentSkipListMap. #19 (comment)Note that this PR excludes
java.util.Propertiesbecause there are anumber of other changes that I'm going to make to it (and then
upstream).