RFR: JDK-8267126: javadoc should show "line and caret" for diagnostics. [v3]

Pavel Rappo prappo at openjdk.java.net
Mon May 24 21:57:48 UTC 2021


On Mon, 24 May 2021 20:32:57 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> 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 incrementally with two additional commits since the last revision:
> 
>  - fix typos
>  - address review feedback

Marked as reviewed by prappo (Reviewer).

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

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


More information about the javadoc-dev mailing list