RFR: JDK-8252712: move doclint to jdk.javadoc module [v4]
Jonathan Gibbons
jjg at openjdk.java.net
Wed Sep 23 18:32:38 UTC 2020
> doclint is a component that can check documentation comments, that can be invoked from either javac or javadoc, via the
> `-Xdoclint` family of options.
> When JDK was modularized in JDK9, doclint was left in the `jdk.compiler` module because of direct references to the
> code from javac, even though functionally the code more naturally belongs in the `jdk.javadoc` module.
> This change moves the code into the `jdk.javadoc`, using a service/provider API to make the functionality available to
> javac. This should be completely transparent, as long as the `jdk.javadoc` module is available when performing service
> binding. If it is not available, a default no-op implementation is automatically used instead. One minor complication:
> the old code used static methods on the `DocLint` class to validate options. This is no longer possible when using the
> service provider mechanism. Instead, the methods are changed to instance methods. The javac `Option` enum has no way to
> cleanly cache an instance of the service provider class, and so a new instance is created for each option. However,
> this is a relatively lightweight operation, and can reasonably be done for the typically few doclint-related options on
> the command line. Note: JShell has been making minor use of an internal doclint class enum `HtmlTag`, which is no
> longer easily available. A minimal local enum is left behind in JShell's `JavadocFomatter` class, sufficient to its
> requirements. Since the dominant use of the enum is in `switch` statements, an alternative solution, avoiding the local
> enum, would be to use strings and _switch on string_ instead. However, the use of the local enum is a smaller
> disturbance to the `JavadocFormatter` class.
Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision:
fix use of fully-qualified name
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/133/files
- new: https://git.openjdk.java.net/jdk/pull/133/files/512b6ba2..34894848
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=133&range=03
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=133&range=02-03
Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/133.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/133/head:pull/133
PR: https://git.openjdk.java.net/jdk/pull/133
More information about the compiler-dev
mailing list