-
Notifications
You must be signed in to change notification settings - Fork 3
Commit 39339b0
authored
Make some type parameters inside
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.ConcurrentHashMap
non-null. (#70)1 parent 7630b5d commit 39339b0Copy full SHA for 39339b0
File tree
1 file changed
+61
-61
lines changed- src/java.base/share/classes/java/util/concurrent
1 file changed
+61
-61
lines changed
0 commit comments