Skip to content

Annotate ConcurrentSkipListMap. - #19

Merged
wmdietl merged 3 commits into
mainfrom
cslm
Jul 12, 2023
Merged

wmdietl merged 3 commits into
mainfrom
cslm

Conversation

@cpovirk

@cpovirk cpovirk commented Jun 16, 2023

Copy link
Copy Markdown
Collaborator

I'm leaving the compute* methods alone until after my pending PRs for
those methods.

I'm leaving the `compute*` methods alone until after my pending PRs for
those methods.

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additions look good. I'm not merging, so you can decide whether you want to annotate the compute methods in this PR or separately.

@wmdietl wmdietl assigned cpovirk and unassigned wmdietl Jun 19, 2023
@cpovirk

cpovirk commented Jul 5, 2023

Copy link
Copy Markdown
Collaborator Author

OK, I made another pass over the compute* methods (and merge while I was at it):

@cpovirk
cpovirk requested a review from wmdietl July 5, 2023 17:18
@cpovirk cpovirk assigned wmdietl and unassigned cpovirk Jul 5, 2023
@cpovirk cpovirk changed the title Annotate most of ConcurrentSkipListMap for nullness. Annotate ConcurrentSkipListMap. Jul 5, 2023

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed description! New changes look good.

@wmdietl
wmdietl merged commit fd32fe8 into main Jul 12, 2023
@wmdietl
wmdietl deleted the cslm branch July 12, 2023 16:29
cpovirk added a commit to cpovirk/jdk that referenced this pull request Jul 12, 2023
Compare jspecify/jdk#19, except that I realized
that I missed a `@Nullable` annotation in `compute` in that PR. I've
included the annotation here, and I'll send another PR to make the same
change in the JSpecify repo.
cpovirk added a commit that referenced this pull request Jul 12, 2023
Despite what I'd claimed in #19, I
didn't make the signatures full match those in `Map`. I discovered this
as I was putting together eisop/jdk#51.
cpovirk added a commit that referenced this pull request Aug 15, 2023
…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
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants