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

8313865: Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B #15672

Closed
wants to merge 1 commit into from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Sep 11, 2023

Simple clean-up for removing an unnecessary condition.


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-8313865: Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B (Bug - P5)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15672

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 11, 2023

👋 Welcome back naoto! 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 Sep 11, 2023
@openjdk
Copy link

openjdk bot commented Sep 11, 2023

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

  • nio

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 nio nio-dev@openjdk.org label Sep 11, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 11, 2023

Webrevs

Copy link
Contributor

@vyommani vyommani left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

LGTM

@openjdk
Copy link

openjdk bot commented Sep 12, 2023

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

8313865: Always true condition in sun.nio.cs.CharsetMapping#readINDEXC2B

Reviewed-by: aturbanov, vtewari, rriggs, iris

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

  • 1d702d2: 8313800: AArch64: SA stack walking code having trouble finding sender frame when invoking LambdaForms is involved
  • e084516: 8315968: Move java.util.Digits to jdk.internal.util and refactor to reduce duplication
  • d75d977: 8285447: StackWalker minimal batch size should be optimized for getCallerClass
  • fc3e826: 8314832: Few runtime/os tests ignore vm flags
  • 347beb2: 8315998: Remove dead ClassLoaderDataGraphKlassIteratorStatic
  • 50158f3: 8316002: Remove unnecessary seen_dead_loader in ClassLoaderDataGraph::do_unloading
  • 6f2684b: 8315948: JDK-8315818 broke Xcomp on libgraal
  • 8b4f9a8: 8315990: Amend problemlisted tests to proper position
  • 455c471: 8313277: Resolve multiple definition of 'normalize' when statically linking JDK native libraries with user code
  • 3b422d0: 8316094: Problemlist compiler/rangechecks/TestRangeCheckHoistingScaledIV.java
  • ... and 4 more: https://git.openjdk.org/jdk/compare/d0be73a78038faf9509623bc4ba71eb4385cd645...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 Sep 12, 2023
@naotoj
Copy link
Member Author

naotoj commented Sep 12, 2023

Thanks all for the reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Sep 12, 2023

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

  • 947dee7: 8316113: Infinite permission checking loop in java/net/spi/InetAddressResolverProvider/RuntimePermissionTest
  • 1d702d2: 8313800: AArch64: SA stack walking code having trouble finding sender frame when invoking LambdaForms is involved
  • e084516: 8315968: Move java.util.Digits to jdk.internal.util and refactor to reduce duplication
  • d75d977: 8285447: StackWalker minimal batch size should be optimized for getCallerClass
  • fc3e826: 8314832: Few runtime/os tests ignore vm flags
  • 347beb2: 8315998: Remove dead ClassLoaderDataGraphKlassIteratorStatic
  • 50158f3: 8316002: Remove unnecessary seen_dead_loader in ClassLoaderDataGraph::do_unloading
  • 6f2684b: 8315948: JDK-8315818 broke Xcomp on libgraal
  • 8b4f9a8: 8315990: Amend problemlisted tests to proper position
  • 455c471: 8313277: Resolve multiple definition of 'normalize' when statically linking JDK native libraries with user code
  • ... and 5 more: https://git.openjdk.org/jdk/compare/d0be73a78038faf9509623bc4ba71eb4385cd645...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 12, 2023

@naotoj Pushed as commit ac2dfe4.

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

@@ -244,7 +239,7 @@ void readSINGLEBYTE() {
void readINDEXC2B() {
char[] map = readCharArray();
for (int i = map.length - 1; i >= 0; i--) {
if (c2b == null && map[i] != -1) {
if (c2b == null) {
Copy link
Member

Choose a reason for hiding this comment

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

Post-review comment:

I don't quite understand this code. c2b is loop-invariant, right? So, what this does is checking for c2b != null, and if so, instantiates the c2b array with new char[map[map.length - 1] + 256]. This does not even require a loop, as written right now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed the code looks weird. Will have a deeper look. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

The code seems to read the data written with this piece of code:

private static void writeINDEXC2B(OutputStream out, int[] indexC2B)

but apparently it does not seem to work as expected. Since this is a very old code, not sure I would proactively modify it though.

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 nio nio-dev@openjdk.org
6 participants