Skip to content

Commit 39339b0

Browse files
authored
Make some type parameters inside ConcurrentHashMap non-null. (#70)
We already had the parameters on the class itself correct. However, we had declarations _inside_ incorrect. This PR fixes most but not all. For the most part, this PR doesn't matter: Most of these APIs are not user-visible. We had them annotated in the first place only because our CF-stub-conversion tool changes `<T>` to `<T extends @nullable Object>` everywhere inside `@NullMarked` code, without regard to whether the API is publicly visible. In fairness, this makes some sense because a non-publicly visible type can be extended by a publicly visible type, which can render the non-publicly visible type's APIs suddenly publicly visible. In fact, that happens in this very file: The package-private `CollectionView` is extended by the public `KeySetView`. Still, for _most_ of the non-visible APIs, this PR has no actual effect: It's just a simplification (by removing information about non-visible APIs, which we don't normally annotate) that happens to also make those APIs' annotations more correct. For public APIs like `KeySetView` itself, it would have made sense for the CF stubs to have `<T extends Object>`, which would have translated into plain `<T>` in our stubs. The PR's change to `<T>` could affect existing callers. I will be back with another PR that handles some other type parameters as part of actually annotating some other unannotated APIs in the class.
1 parent 7630b5d commit 39339b0

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

0 commit comments

Comments
 (0)