Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information