Please review a workaround/fix for an NPE in HtmlDocletWriter.

The underlying problem is triggered by having a method with no comment override 
a method with bad/malformed comments. That is then handled poorly in 
`HtmlDocletWriter.commentTagsToContent` which uses an incorrect `CommentHelper`.

The workaround fix is to check for a null `DocTreePath` from 
`CommentHelper.getDocTreePath`, and to suppress prin ting the error message in 
that case.  The error message will typically have been generated for the bad 
comments in the super type, so dropping the message is not such a bad thing 
anyway.

The diagnostic is improved by using a new/different message when the node does 
not seem to be tag-related.  In addition, the erroneous text is presented "as 
text" and not "as raw HTML".   These changes affect a couple of otherwise 
unrelated tests.

A new test is added, that exercises the conditions that gave rise to the NPE.

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

Commit messages:
 - fix whitespace
 - update bug number in test
 - JDK-8269722: NPE in HtmlDocletWriter

Changes: https://git.openjdk.java.net/jdk17/pull/190/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=190&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269722
  Stats: 113 lines in 5 files changed: 107 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/190.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/190/head:pull/190

PR: https://git.openjdk.java.net/jdk17/pull/190

Reply via email to