RFR: JDK-8303349: Simplify link format for generic types in index pages

Jonathan Gibbons jjg at openjdk.org
Thu Mar 9 23:06:07 UTC 2023


On Tue, 28 Feb 2023 14:04:19 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

> Please review a simple change to simplify the format of links to generic types in various JavaDoc index pages. Previously, these included dedicated links for type parameters and bounds, which seems excessive for use in an index. 
> 
> Below are before and after screenshots for `Spliterator.ofPrimitive` (which is admittedly an extreme case) and neighboring index entries. Note that now links to generic types match what we do for executables, where the whole signature is used as link label.
> 
> Before:
> <img width="804" alt="index-generic-links-1" src="https://user-images.githubusercontent.com/15975/221875901-07899cc7-8822-4e59-8b93-51efb6795a83.png">
> 
> After:
> <img width="546" alt="index-generic-links-2" src="https://user-images.githubusercontent.com/15975/221875944-b3db5fab-4e11-493b-8499-54bfeccbeb65.png">

Approved, with quibbles on comments for your consideration.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java line 48:

> 46:     public enum Kind {
> 47:         /**
> 48:          * Creates a link with just the element name as label.

(Minor)
The use of `Creates` makes this seem like a doc comment for a method. Enum constants are state/variables, not methods.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkInfo.java line 237:

> 235:     @Override
> 236:     public boolean showTypeParameters() {
> 237:         // Type parameters parameters for these kinds of links are either not desired

duplicate word `parameters`

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

Marked as reviewed by jjg (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12786


More information about the javadoc-dev mailing list