Skip to content

JDK-8305710: Line breaks in search tags cause invalid JSON in index file #14016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

hns
Copy link
Member

@hns hns commented May 16, 2023

This fixes a number of issues that can or could result in invalid JavaScript search index files, and a single invalid index file breaking the whole JavaDoc search feature.

  • The IndexItem now throws IllegalArgumentException if the label argument contains a line break. This was the original cause for this bug and was already fixed in JDK-8305407, but it is a good idea to add the explicit check to fail in a visible way should it occur again.
  • The IndexItem.escapeQuotes(String) method now escapes backslashes in addition to quote. Failure to escape a trailing backslash would result in an escaped quote, leading to an invalid index file.
  • The search script gets a check for null/undefined to avoid a missing tag index file to break the search feature as a whole.

Note that the added test covers only the second item in the list above. The other two changes are trivial and would require undue effort to test.

I also removed a few boolean parameters from test methods in TestSearch.java that are always called with true as value.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8305710: Line breaks in search tags cause invalid JSON in index file

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14016/head:pull/14016
$ git checkout pull/14016

Update a local copy of the PR:
$ git checkout pull/14016
$ git pull https://git.openjdk.org/jdk.git pull/14016/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14016

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14016.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 16, 2023

👋 Welcome back hannesw! 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 openjdk bot added the rfr Pull request is ready for review label May 16, 2023
@openjdk
Copy link

openjdk bot commented May 16, 2023

@hns 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.org label May 16, 2023
@mlbridge
Copy link

mlbridge bot commented May 16, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented May 24, 2023

@hns 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:

8305710: Line breaks in search tags cause invalid JSON in index file

Reviewed-by: jjg

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 139 new commits pushed to the master branch:

  • 207fbcb: 8299414: JVMTI FollowReferences should support references from VirtualThread stack
  • b44fa36: 8308040: Evaluate new public types in non-public classes
  • ac89e30: 8308291: compiler/jvmci/meta/ProfilingInfoTest.java fails with -XX:TieredStopAtLevel=1
  • bacf652: 8297887: Update Siphash
  • 89f2d45: 8308237: add JDWP and JDI virtual thread support for ThreadReference.PopFrames
  • d10467e: 8307738: JFR: EventStream.openRepository() drops events
  • 736b90d: 8308310: HttpClient: Avoid logging or locking from within synchronized blocks
  • 7764f46: 8308761: New test TestHFA needs adaptation for JDK-8308276
  • d7245f7: 8305578: X11GraphicsDevice.pGetBounds() is slow in remote X11 sessions
  • 544978c: 8298066: java/util/concurrent/locks/Lock/OOMEInAQS.java timed out
  • ... and 129 more: https://git.openjdk.org/jdk/compare/72294c5402dd11e3eb4922ad26e1b153098495ff...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 May 24, 2023
@hns
Copy link
Member Author

hns commented May 25, 2023

/integrate

@openjdk
Copy link

openjdk bot commented May 25, 2023

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

  • 3f4abff: 8305958: Use links instead of buttons for auto-generated header links
  • bfcae68: 8308549: Classfile API should fail to generate over-sized Code attribute
  • 2a18e53: 8308656: RISC-V: vstring_compare doesnt manifest usage of all vector registers
  • a291f00: 8288619: Unexpected parsing for @see
  • 89b9914: 8308400: add ForceEarlyReturn support for virtual threads
  • 1451ac1: 8307652: sealed class hierarchy graph doesn't distinguish non-sealed classes
  • 207fbcb: 8299414: JVMTI FollowReferences should support references from VirtualThread stack
  • b44fa36: 8308040: Evaluate new public types in non-public classes
  • ac89e30: 8308291: compiler/jvmci/meta/ProfilingInfoTest.java fails with -XX:TieredStopAtLevel=1
  • bacf652: 8297887: Update Siphash
  • ... and 135 more: https://git.openjdk.org/jdk/compare/72294c5402dd11e3eb4922ad26e1b153098495ff...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 25, 2023
@openjdk openjdk bot closed this May 25, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 25, 2023
@openjdk
Copy link

openjdk bot commented May 25, 2023

@hns Pushed as commit 3272e25.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants