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

JDK-8297299 SequenceInputStream should not use Vector #11249

Closed
wants to merge 5 commits into from

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Nov 19, 2022

There is no need to use a temporary Vector within the constructor of SynchronizedInputStream, as more efficient (non-synchronized) alternative code (like List.of) will do the same in possibly less time. While the optimization is not dramatic, it still makes sense to replace Vector unless synchronization is really needed.


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-8297299: SequenceInputStream should not use Vector

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11249

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 19, 2022

👋 Welcome back mkarg! 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
Copy link

openjdk bot commented Nov 19, 2022

@mkarg 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 core-libs-dev@openjdk.org label Nov 19, 2022
@mkarg mkarg marked this pull request as ready for review November 19, 2022 21:52
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 19, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 19, 2022

Webrevs

@AlanBateman
Copy link
Contributor

Jai is correct, this constructor appears to have tolerated null in the second parameter since JDK 1.0 so we need to proceed with care. The SIS constructor that takes an Enumeration is similar in that it only throws NPE if the first element is null, it probably should have taken a defensive copy but that can't be changed now as there may be lazy implementations in the wild that depend on existing behavior.

@mkarg
Copy link
Contributor Author

mkarg commented Nov 20, 2022

Jai is correct, this constructor appears to have tolerated null in the second parameter since JDK 1.0 so we need to proceed with care.

I have fixe this in b6ccec2, so it still uses List.of but keeps the historic behavior.

I wonder if we shouldn't change the Javadocs so they clearly tell the reader that s2 MAY be null?

@openjdk-notifier
Copy link

@mkarg Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@jaikiran
Copy link
Member

Thank you Markus for the changes. The latest version in 2e957354 looks fine to me. While we are at it, would you be willing to change the member variables e to private final and the in to private? From what I can see, I don't see any other class accessing these package private fields.

@mkarg
Copy link
Contributor Author

mkarg commented Nov 21, 2022

While we are at it, would you be willing to change the member variables e to private final and the in to private? From what I can see, I don't see any other class accessing these package private fields.

Good catch, will do later today.

@mkarg
Copy link
Contributor Author

mkarg commented Nov 21, 2022

While we are at it, would you be willing to change the member variables e to private final and the in to private? From what I can see, I don't see any other class accessing these package private fields.

Fixed in 8d29831 :-)

@mkarg
Copy link
Contributor Author

mkarg commented Nov 21, 2022

@jaikiran Kindly requesting your review approval. :-)

@openjdk
Copy link

openjdk bot commented Nov 21, 2022

⚠️ @mkarg the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout sequenceinputstream-vector
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Nov 21, 2022

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

8297299: SequenceInputStream should not use Vector

Reviewed-by: alanb, jpai

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

  • 5a45c25: 8297164: Update troff man pages and CheckManPageOptions.java
  • f12710e: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions
  • cd6a203: 8297348: make CONF=xxx should match if xxx is an exact match
  • 817e039: 8297352: configure should check pandoc version
  • 15e2e28: 8297353: Regenerated checked-in html files with new pandoc
  • b366d17: 8294073: Performance improvement for message digest implementations
  • 57f5cfd: 8296399: crlNumExtVal might be null inside X509CRLSelector::match
  • 0b04a99: 8297347: Problem list compiler/debug/TestStress*.java
  • 0ac0148: 8297342: make LOG=debug is too verbose
  • d0a7938: 8286575: Document how properties in java.security are parsed
  • ... and 18 more: https://git.openjdk.org/jdk/compare/251e065a1721ea83dd18277aeae69e257ba60bd4...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 (@AlanBateman, @jaikiran) 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 Pull request is ready to be integrated label Nov 21, 2022
@mkarg
Copy link
Contributor Author

mkarg commented Nov 21, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 21, 2022
@openjdk
Copy link

openjdk bot commented Nov 21, 2022

@mkarg
Your change (at version 8d29831) is now ready to be sponsored by a Committer.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

Thank you Markus for these changes. The latest state in 8d298318 looks good to me. I'll run some tests today before sponsoring this.

@jaikiran
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 22, 2022

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

  • f0e99c6: 8297301: Cleanup unused methods in JavaUtilJarAccess
  • 392ac70: 8297211: Expensive fillInStackTrace operation in HttpURLConnection.getOutputStream0 when no content-length in response
  • 5a45c25: 8297164: Update troff man pages and CheckManPageOptions.java
  • f12710e: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions
  • cd6a203: 8297348: make CONF=xxx should match if xxx is an exact match
  • 817e039: 8297352: configure should check pandoc version
  • 15e2e28: 8297353: Regenerated checked-in html files with new pandoc
  • b366d17: 8294073: Performance improvement for message digest implementations
  • 57f5cfd: 8296399: crlNumExtVal might be null inside X509CRLSelector::match
  • 0b04a99: 8297347: Problem list compiler/debug/TestStress*.java
  • ... and 20 more: https://git.openjdk.org/jdk/compare/251e065a1721ea83dd18277aeae69e257ba60bd4...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 22, 2022
@openjdk openjdk bot closed this Nov 22, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 22, 2022
@openjdk
Copy link

openjdk bot commented Nov 22, 2022

@jaikiran @mkarg Pushed as commit 0696854.

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

@mkarg mkarg deleted the sequenceinputstream-vector branch November 22, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants