RFR: JDK-8267126: javadoc should show "line and caret" for diagnostics. [v4]
Jonathan Gibbons
jjg at openjdk.java.net
Tue May 25 01:31:38 UTC 2021
> Please review a change to overhaul the javadoc support for diagnostics to better leverage the support available in javac. This includes the ability for all javadoc diagnostics to show a "source line and caret" to indicate the position of a reported issue. As a side-effect, it normalizes the formatting of javadoc messages, to be consistent with javac messages.
>
> The primary changes are in the javadoc `Messager` class, and are primarily focussed "downward" on the internal use of the javac `Log.report` method, which is the nexus for reporting methods. There is additional cleanup that could be done in `Messager` in the API it provides to clients, but (for the most part) that is not done in this work.
>
> Additional changes are done to facilitate writing a test for this work, and reflect the current shortcomings of the existing `Doclet` API. Most notably:
> * changes in `Utils` to allow a user-defined taglet to override a built-in taglet
> * changes in `TagletManager` and `Workarounds` to allow a user-defined taglet to access internal API, to workaround API that would be useful to provide on `StandardDoclet`
>
> There are a few minor specific cleanup changes in code style and/or improved comments.
>
> There is one primary new test, `TestDiagsLineCaret.java` which exercises different kinds of diagnostics at different positions in a file, to verify that the source line and a caret are produced as appropriate.
>
> There are additional test changes triggered by the slight change in the format of error messages. Most notably, prefixes like `error -` and `warning -` become `error:` and `warning:`.
Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
- Merge with upstream/master
- fix typos
- address review feedback
- minor cleanup
- JDK-8267126: javadoc should show "line and caret" for diagnostics.
-------------
Changes: https://git.openjdk.java.net/jdk/pull/4074/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4074&range=03
Stats: 935 lines in 37 files changed: 629 ins; 103 del; 203 mod
Patch: https://git.openjdk.java.net/jdk/pull/4074.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4074/head:pull/4074
PR: https://git.openjdk.java.net/jdk/pull/4074
More information about the javadoc-dev
mailing list