RFR: JDK-8258957: DocLint: check for HTML start element at end of body

Jonathan Gibbons jjg at openjdk.java.net
Sat Mar 6 09:00:19 UTC 2021

Please review a moderately simple fix to improve DocLint's checking for empty tags, and in particular, bad use of `<p>` as a paragraph terminator. This will help detect this bad usage at doclint-time, instead of later, with doccheck.

There was already code to check if tags were empty. (`warnIfEmpty`), and code to check for open tags at the end of the comment. The change is primarily to invoke the "check for open tags" at the end of main body of a comment and at the end of each block tag (i.e including all that allow HTML content in the body of the block tag.) 

There is a secondary minor edit to check if a tag was empty when auto-closing it.

The changes discovered 5 instances of bad use of `<p>` in the JDK docs. These are being fixed separately in https://bugs.openjdk.java.net/browse/JDK-8263104


Commit messages:
 - JDK-8258957: DocLint: check for HTML start element at end of body

Changes: https://git.openjdk.java.net/jdk/pull/2853/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2853&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258957
  Stats: 85 lines in 5 files changed: 82 ins; 1 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2853.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2853/head:pull/2853

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

More information about the compiler-dev mailing list