-
Notifications
You must be signed in to change notification settings - Fork 88
7904021: Parsing group files using non-UTF-8 encoding fails #267
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
Conversation
|
👋 Welcome back psoujany! A progress list of the required criteria for merging this PR into |
|
@psoujany 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: 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 6 new commits pushed to the
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 (@sormuras) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Looking at the former implementation, without NIO API usage, the file read by those methods were assumed to be encoded in Using |
|
Please update the title of this PR to read: Also, fix the PR body to appear not empty. |
|
@sormuras I've updated the PR title and body. Thank you. |
|
The two places changed in this PR aren't all places in which With https://openjdk.org/jeps/400 UTF-8 is the default charset of the standard Java APIs. Yes, that relates to Java 18+, but did you try to store those group files in UTF-8 encoding in your local environment? Did you try passing |
|
In our testing we noticed these 2 places which resolved our issue, will check other places where the change is required. Yes, we tried keeping We also tried passing |
|
Right, using And before the conversion to use NIO, the
Since jtreg 7, with CODETOOLS-7903091 included, the Thus, all-in-all, your change resolves a regression. In the light of that, I'll approve and sponsor this pull request. |
|
/integrate |
|
/sponsor |
|
Going to push as commit 439cb91.
Your commit was automatically rebased without conflicts. |
|
Hi @sormuras , I'm looking for this change to be present in jtreg 7.3.1 which is the minimum jtreg version for JDK11 and 17. Could you please help me in getting this PR merged to jtreg7.3.1 binaries with this fix. Thank you. |
We make use of jtreg to execute openjdk tests for JDK11/17/21 releases on non-UTF-8 returning platforms. We found latest jtreg code is using Files.newBufferedReader(path) to read group files data(TEST.GROUPS) from openjdk via GroupManager (https://github.com/openjdk/jtreg/blob/master/src/share/classes/com/sun/javatest/regtest/config/GroupManager.java#L102C44-L102C61).
This code defaults to return BufferedReader as UTF-8 instance. We see discrepancies when using this version of jtreg on non-UTF-8 platforms where defaultCharset() is non-UTF-8(JDK11 and JDK17).
Hence, we would like to propose a fix of using default.Charset() with Files.newBufferedWriter(Path path, Charset cs) instead of Files.newBufferedReader(path) and Files.readString(Path) to Files.readString(Path,Charset cs) in below jtreg files :
https://github.com/openjdk/jtreg/blob/master/src/share/classes/com/sun/javatest/regtest/config/GroupManager.java#L102C44-L102C61
https://github.com/openjdk/jtreg/blob/master/src/share/classes/com/sun/javatest/regtest/config/ExtraPropDefns.java#L309
We've also tested this fix on OpenJDK supported platforms like Linux, Windows, MAC.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/267/head:pull/267$ git checkout pull/267Update a local copy of the PR:
$ git checkout pull/267$ git pull https://git.openjdk.org/jtreg.git pull/267/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 267View PR using the GUI difftool:
$ git pr show -t 267Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/267.diff
Using Webrev
Link to Webrev Comment
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/267/head:pull/267$ git checkout pull/267Update a local copy of the PR:
$ git checkout pull/267$ git pull https://git.openjdk.org/jtreg.git pull/267/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 267View PR using the GUI difftool:
$ git pr show -t 267Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/267.diff
Using Webrev
Link to Webrev Comment