RFR: 8301813: Bad caret position in error message

Jonathan Gibbons jjg at openjdk.org
Fri Feb 3 23:04:39 UTC 2023

Please review a trivial update to `DocCommentParser` and corresponding updates to tests, to fix the caret position in the two forms of the "no tag name found" error message.

The fix is simply to use the overload of `erroneous` that allows the preferred caret position to be specified. This overload was not available at the time the affected lines were originally written.

The "natural" place to test this is in the `doctree` tests (that is, `TagTest.java`) but that test is not set up for easy monitoring of the end-user visible caret, so a new doclet test is created for that. (`TestNoTagName.java`).   

BadPackageCommentTest.java is also affected. It is updated in a manner similar to that in a parallel PR for handling at-escapes. However, the changed caret position will eventually probably cause a minor change conflict that will need to be resolved.


Commit messages:
 - 8301813: Bad caret position in error message

Changes: https://git.openjdk.org/jdk/pull/12421/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12421&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8301813
  Stats: 148 lines in 5 files changed: 134 ins; 6 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/12421.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12421/head:pull/12421

PR: https://git.openjdk.org/jdk/pull/12421

More information about the compiler-dev mailing list