Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

JDK-8269722: NPE in HtmlDocletWriter #190

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Jul 1, 2021

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 printing 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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/190/head:pull/190
$ git checkout pull/190

Update a local copy of the PR:
$ git checkout pull/190
$ git pull https://git.openjdk.java.net/jdk17 pull/190/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 190

View PR using the GUI difftool:
$ git pr show -t 190

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/190.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 1, 2021

👋 Welcome back jjg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 1, 2021

@jonathan-gibbons The following label will be automatically applied to this pull request:

  • javadoc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.java.net label Jul 1, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 1, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 1, 2021

Webrevs

Copy link
Member

@hns hns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@openjdk
Copy link

openjdk bot commented Jul 8, 2021

@jonathan-gibbons This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8269722: NPE in HtmlDocletWriter

Reviewed-by: hannesw

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 50 new commits pushed to the master branch:

  • 9acb2a6: 8270109: ProblemList 4 SA tests on macOS-aarch64
  • f46a917: 6766844: ByteArrayInputStream#read with a byte array of length 0 not consistent with InputStream when at EOF
  • 9e75f92: 8269738: AssertionError when combining pattern matching and function closure
  • 168af2e: 8269828: corrections in some instruction patterns for KNL x86 platform
  • fa08cc6: 8268766: Desugaring of pattern matching enum switch should be improved
  • 4f70759: 8270006: Switches with 'case null:' should be exhaustive
  • 8f798b8: 8269746: C2: assert(!in->is_CFG()) failed: CFG Node with no controlling input?
  • c812bbb: 8269929: (test) Add diagnostic info to ProceessBuilder/Basic.java for unexpected output
  • 6000950: 8269185: Directories in /opt/runtimepackagetest and /path/to/jdk-17 are different
  • 1f2bf1d: 8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode
  • ... and 40 more: https://git.openjdk.java.net/jdk17/compare/38260122815aed32627472e5d58b516e89ef7bd7...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 8, 2021
@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 8, 2021

Going to push as commit 6401633.
Since your change was applied there have been 50 commits pushed to the master branch:

  • 9acb2a6: 8270109: ProblemList 4 SA tests on macOS-aarch64
  • f46a917: 6766844: ByteArrayInputStream#read with a byte array of length 0 not consistent with InputStream when at EOF
  • 9e75f92: 8269738: AssertionError when combining pattern matching and function closure
  • 168af2e: 8269828: corrections in some instruction patterns for KNL x86 platform
  • fa08cc6: 8268766: Desugaring of pattern matching enum switch should be improved
  • 4f70759: 8270006: Switches with 'case null:' should be exhaustive
  • 8f798b8: 8269746: C2: assert(!in->is_CFG()) failed: CFG Node with no controlling input?
  • c812bbb: 8269929: (test) Add diagnostic info to ProceessBuilder/Basic.java for unexpected output
  • 6000950: 8269185: Directories in /opt/runtimepackagetest and /path/to/jdk-17 are different
  • 1f2bf1d: 8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode
  • ... and 40 more: https://git.openjdk.java.net/jdk17/compare/38260122815aed32627472e5d58b516e89ef7bd7...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 8, 2021
@openjdk
Copy link

openjdk bot commented Jul 8, 2021

@jonathan-gibbons Pushed as commit 6401633.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.java.net
2 participants