RFR: 8342808: Javadoc should add whitespace between type parameters

Jonathan Gibbons jjg at openjdk.org
Thu Oct 31 15:09:28 UTC 2024


On Tue, 29 Oct 2024 11:14:54 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

> Please review this patch to render javadocs as `<K, V, T>` rather than `<K,V,T>` to match naming conventions and make the rendered output slighly nicer to read.
> 
> Passes langtool tests.
> 
> The[ generated docs](https://cr.openjdk.org/~nbenalla/GeneratedDocs/TypeParams/docs/api/index.html) only includes `java.base/lang`, `java.base/util` and `java.compiler/javax`

I think there are potentially two common styles in play.  
* Declarations of parameterized types, for which single letters are commonly used for the type _parameters_:  `Map<K,V>`
* Uses of parameterized types, in which the type _arguments_ are longer type expressions: `Map<String, List<Integer>>`

In the first, it is common to not use whitespace; in the second, whitespace seems appropriate.

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

PR Comment: https://git.openjdk.org/jdk/pull/21759#issuecomment-2450120306


More information about the javadoc-dev mailing list