RFR: JDK-8266748: Move modifiers code to Signatures.java

Jonathan Gibbons jjg at openjdk.java.net
Fri May 28 15:54:02 UTC 2021


On Fri, 21 May 2021 08:46:48 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

> This change consolidates the code to generate type signature modifiers into `Signatures.TypeSignature`. 
> 
> Although this mostly consists of moving the code from `ClassWriterImpl` and `Utils` to `Signatures`, I also avoided the need to split the modifiers string when processing preview modifiers by returning a `List<String>` instead of a `String` in what used to be `Utils.modifiersToString` and is now `TypeSignature.getModifiers`.

General comments; not a final review.

* Moving code out of `Utils` is generally always good but it's a bit of a shame to move it down into `formats.html`. That being said, `Signatures` is a good abstraction to be building.

* The medium amount of use of `HtmlDocletWriter` in `Signatures` is a code-smell, although arguably, we're just exposing an existing code-smell. We should (generally) continue our efforts to move code out of `HtmlDocletWriter` into other more-focussed abstractions.

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

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


More information about the javadoc-dev mailing list