RFR: JDK-8285676: Add missing @param tags for type parameters on classes and interfaces [v2]

Stuart Marks smarks at openjdk.java.net
Wed Apr 27 23:31:55 UTC 2022


On Wed, 27 Apr 2022 23:04:47 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/AbstractMap.java line 601:
>> 
>>> 599:      * {@code Map.entrySet().toArray}.
>>> 600:      *
>>> 601:      * @param <K> the type of keys maintained
>> 
>> Please update to match java.util.Map, which says "the type of keys maintained by this map"
>
> I said "keys maintained", omitting "by this map" to finesse the question of if the SimpleEntry class *is* a map, or is used to implement a map, etc. I can change it to include "by this map" if the map/entry distinction is okay to be blurred.

Whoops, sorry, this is `SimpleEntry`, which is _not_ a `Map`. In this case I'd follow `Map.Entry` which says "the type of the key" and "the type of the map".

>> src/java.base/share/classes/java/util/Dictionary.java line 44:
>> 
>>> 42:  * @param <K> the type of keys
>>> 43:  * @param <V> the type of mapped values
>>> 44:  *
>> 
>> Urgh. This class is obsolete, but it was retrofitted to implement Map and was subsequently generified, so I'd update these to match java.util.Map.
>
> The javadoc of Dictionary states "The Dictionary class [...] maps keys to values." which was my guide for the wording, but I don't mind changing it.

My bad, `Dictionary` was not retrofitted to implement `Map` but it gained `K` and `V` type parameters to align with `Map`. No need to change this; it doesn't really matter.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8410



More information about the security-dev mailing list