-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8305902: (cs) Resolve default Charset only once in StreamEncoder and StreamDecoder #13443
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 stsypanov! A progress list of the required criteria for merging this PR into |
@stsypanov The following label will be automatically applied to this pull request:
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. |
try { | ||
return new StreamDecoder(in, lock, Charset.forName(csn)); | ||
return new StreamDecoder(in, lock, csn == null ? Charset.defaultCharset() : Charset.forName(csn)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check the callers, it may be that the mapping of null to the default CS can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callers throw NPE in case of null csName, but both are Encoder and Decoder are public. Will it be safe to remove explicit null check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sun.nio.cs is a JDK internal package. The only usages of StreamDecoder.forInputStreamReader and StreamEncoder.forOutputStreamWriter. You should be able to quickly check the usages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm that you've run test/jdk:tier2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still running, NIO tests are ok
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
jtreg:test/jdk:jdk_nio 475 475 0 0
==============================
TEST SUCCESS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jdk_io test group will probably exercise this code the most, running test/jdk:tier2 is best for the case as it will run the jdk_io, jdk_nio and other tests that directly/indirectly make use of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of jdk:tier2 there are 4 failed tests, I suspect this is due to networking issues as I run them on virtual env
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
>> jtreg:test/jdk:tier2 4046 4032 4 10 <<
==============================
TEST FAILURE
JT Harness : Tests that failed
com/sun/jndi/ldap/LdapPoolTimeoutTest.java: Multi-threaded client timeout tests for ldap pool
java/net/InetAddress/IsReachableViaLoopbackTest.java: ensure we can't ping external hosts via loopback if
java/net/InetAddress/getOriginalHostName.java: test functionality of getOriginalHostName(InetAddress)
java/net/MulticastSocket/Promiscuous.java: Test for interference when two sockets are bound to the same port but joined to different multicast groups
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the callers and none of them expect null to be mapped to the default charset so I think this change is good, assuming you've run tier2.
@stsypanov 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 36 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 (@AlanBateman, @bplb) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@stsypanov |
/sponsor |
Going to push as commit 287bb06.
Your commit was automatically rebased without conflicts. |
@AlanBateman @stsypanov Pushed as commit 287bb06. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
If
charsetName
passed intoforOutputStreamWriter()
method is null thenCharset.forName()
is redundant as we can use already resolved default Charset.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13443/head:pull/13443
$ git checkout pull/13443
Update a local copy of the PR:
$ git checkout pull/13443
$ git pull https://git.openjdk.org/jdk.git pull/13443/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13443
View PR using the GUI difftool:
$ git pr show -t 13443
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13443.diff
Webrev
Link to Webrev Comment