Skip to content
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

8268457: XML Transformer outputs Unicode supplementary character incorrectly to HTML #4474

Closed
wants to merge 4 commits into from

Conversation

@masyano
Copy link

@masyano masyano commented Jun 11, 2021

Hi all,

Could you please review the 8268457 bug fixes?

The problem is that ToHTMLStream applies processing for non-surrogate pairs to the surrogate pair.
This fix changes the processing for non-surrogate pairs to the else condition.


Progress

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

Issue

  • JDK-8268457: XML Transformer outputs Unicode supplementary character incorrectly to HTML

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4474

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

Using diff file

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

@bridgekeeper bridgekeeper bot added the oca label Jun 11, 2021
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 11, 2021

Hi @masyano, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user masyano" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 11, 2021

@masyano The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs label Jun 11, 2021
@masyano
Copy link
Author

@masyano masyano commented Jun 11, 2021

/covered

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 11, 2021

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@openjdk openjdk bot added the rfr label Jun 11, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 11, 2021

Webrevs

@JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Jun 15, 2021

The fix looks good to me.

For ToHTMLStream, please update the copyright year to 2021 (s/2019/2021) and s/@lastmodified: Aug 2019/ @lastmodified: June 2021.

For the test, please move it to test/jaxp/javax/xml/jaxp/unittest/transform and make it a testng test (add @run testng transform.SurrogateTest, and @test to each test case).
For the test itself, you may replace the try-finally block with a try-with-resources statement. For comparing with the gold files, please take a look at the existing test library, specifically test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java, and do it the testng way, e.g. Assert.assertTrue(compareWithGold(goldFile, outputFile));

else
*/
Copy link
Member

@naotoj naotoj Jun 16, 2021

I just wonder the bug was caused by this commenting out, which erroneously removed the else here. If the comment-out portion is no longer needed, we could just delete it for good.

@masyano
Copy link
Author

@masyano masyano commented Jun 18, 2021

Thank you for reviewing. I reflected the review comments to my change.

@@ -1451,22 +1451,24 @@ else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF)
{
writer.write(ch); // no escaping in this case
}
else
Copy link
Member

@naotoj naotoj Jun 18, 2021

I was suggesting removing the entire comment-out block if it is not needed (and confusing), but I will defer the decision to Joe.

Copy link
Member

@JoeWang-Java JoeWang-Java Jun 18, 2021

I agree. It's very obsolete. The comment-out block from line 1445 to 1454 can be removed.

Copy link
Author

@masyano masyano Jun 23, 2021

I was mistaken. I deleted the entire comment.

<?xml version="1.0" encoding="UTF-8"?>
<root>
<tag1>𠮟</tag1>
</root>
Copy link
Member

@naotoj naotoj Jun 18, 2021

Add a new line at the end of the file (and other newly created files too).

Copy link
Author

@masyano masyano Jun 23, 2021

I added a new line at the end of every new file.

Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

The updated changes look reasonable to me.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

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

8268457: XML Transformer outputs Unicode supplementary character incorrectly to HTML

Reviewed-by: lancea, naoto, iris, joehw

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

  • 3ad20fc: 8269571: NMT should print total malloc bytes and invocation count
  • b969136: 8245877: assert(_value != __null) failed: resolving NULL _value in JvmtiExport::post_compiled_method_load
  • ee526a2: Merge
  • 0d745ae: 8269034: AccessControlException for SunPKCS11 daemon threads
  • d042029: 8269529: javax/swing/reliability/HangDuringStaticInitialization.java fails in Windows debug build
  • 401cb0a: 8269232: assert(!is_jweak(handle)) failed: wrong method for detroying jweak
  • b8a16e9: 8268884: C2: Compile::remove_speculative_types must iterate top-down
  • 25f9f19: 8249646: Runtime.exec(String, String[], File) documentation contains literal {@link ...}
  • 0d83dc2: 8268699: Shenandoah: Add test for JDK-8268127
  • 7010dfd: 8269517: compiler/loopopts/TestPartialPeelingSinkNodes.java crashes with -XX:+VerifyGraphEdges
  • ... and 292 more: https://git.openjdk.java.net/jdk/compare/2bfd708e9276bd9a6d4cf493e1af3a8e5b8026d2...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@LanceAndersen, @naotoj, @irisclark, @JoeWang-Java) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Jun 23, 2021
naotoj
naotoj approved these changes Jun 23, 2021
Copy link
Member

@naotoj naotoj left a comment

Looks good. Thank you for the fix!

@JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Jun 23, 2021

Thanks for the update. A full test passed.

@JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Jun 25, 2021

Hi Masanori, you may now type /integrate in a new comment when you're ready. I'll then sponsor your change. Thanks.

@masyano
Copy link
Author

@masyano masyano commented Jun 30, 2021

/integrate

@openjdk openjdk bot added the sponsor label Jun 30, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 30, 2021

@masyano
Your change (at version 1183c2f) is now ready to be sponsored by a Committer.

@JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Jun 30, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Jun 30, 2021

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

  • 1810b1c: 8269516: AArch64: Assembler cleanups
  • a96012a: 8261495: Shenandoah: reconsider update references memory ordering
  • 23d2996: 8269478: Shenandoah: gc/shenandoah/mxbeans tests should be more resilient
  • a6b253d: 8269416: [JVMCI] capture libjvmci crash data to a file
  • a0f32cb: 8268906: gc/g1/mixedgc/TestOldGenCollectionUsage.java assumes that GCs take 1ms minimum
  • ee0247f: 8263461: jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java uses wrong mechanism to cause evacuation failure
  • 3ad20fc: 8269571: NMT should print total malloc bytes and invocation count
  • b969136: 8245877: assert(_value != __null) failed: resolving NULL _value in JvmtiExport::post_compiled_method_load
  • ee526a2: Merge
  • 0d745ae: 8269034: AccessControlException for SunPKCS11 daemon threads
  • ... and 298 more: https://git.openjdk.java.net/jdk/compare/2bfd708e9276bd9a6d4cf493e1af3a8e5b8026d2...master

Your commit was automatically rebased without conflicts.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 30, 2021

@JoeWang-Java @masyano Pushed as commit 83bce94.

💡 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
5 participants