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

8268873: Unnecessary Vector usage in java.base #4482

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Jun 14, 2021

Usage of thread-safe collection Vector is unnecessary. It's recommended to use ArrayList if a thread-safe implementation is not needed. In post-BiasedLocking times, this is gets worse, as every access is synchronized.
I checked only places where Vector was used as local variable.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4482

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 14, 2021

👋 Welcome back turbanoff! 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 Jun 14, 2021

@turbanoff 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 Jun 14, 2021
@turbanoff turbanoff changed the title [PATCH] Unnecessary Vector usage in JarIndex.read [PATCH] Unnecessary Vector usage in java.base Jun 14, 2021
@AlanBateman
Copy link
Contributor

/label add security

@openjdk openjdk bot added the security security-dev@openjdk.org label Jun 14, 2021
@openjdk
Copy link

openjdk bot commented Jun 14, 2021

@AlanBateman
The security label was successfully added.

SignerInfo[] result = new SignerInfo[intResult.size()];
intResult.copyInto(result);
return result;
return intResult.toArray(result);
Copy link
Contributor

Choose a reason for hiding this comment

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

could be simplified to
return intResult.toArray(new SignerInfo[0]);
which would eliminate array zeroing as bonus as I have learned from your other PR ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered this, when I was preparing the patch. But decided to reduce scope of changes.

@stsypanov
Copy link
Contributor

I've filed https://bugs.openjdk.java.net/browse/JDK-8268873 for this, just put /issue 8268873 as a comment for this ticket to bind it to the issue

@turbanoff
Copy link
Member Author

/issue 8268873

@openjdk openjdk bot changed the title [PATCH] Unnecessary Vector usage in java.base 8268873: Unnecessary Vector usage in java.base Jun 16, 2021
@openjdk
Copy link

openjdk bot commented Jun 16, 2021

@turbanoff The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 16, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 16, 2021

Webrevs

Copy link
Member

@seanjmullan seanjmullan left a comment

Choose a reason for hiding this comment

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

The change to PKCS7::verify(byte[]) looks fine.

@openjdk
Copy link

openjdk bot commented Jun 18, 2021

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

8268873: Unnecessary Vector usage in java.base

Reviewed-by: mullan

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

  • e515873: 8269216: Useless initialization in com/sun/crypto/provider/PBES2Parameters.java
  • 51d9159: 8236212: CompiledMethodLoad and CompiledMethodUnload events can be posted in START phase
  • 280f2d5: 8268433: serviceability/dcmd/framework/VMVersionTest.java fails with Unable to send object throw not established PipeIO Listener Thread connection
  • f375916: 8269186: [REDO] Remove CodeCache::mark_for_evol_deoptimization() method
  • 7621fa3: 8268464: Remove dependancy of TestHttpsServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/https/ tests
  • f3ba269: 8256306: ObjectMonitor::_contentions field should not be 'jint'
  • 52d5d1b: 8269188: [BACKOUT] Remove CodeCache::mark_for_evol_deoptimization() method
  • f2e690e: 8268720: Unspecified checks on NameAndType constants should not be performed
  • 2c29d79: 8269206: A small typo in comment in test/lib/sun/hotspot/WhiteBox.java
  • 6237630: 8269120: Build failure with GCC 6.3.0 after JDK-8017163
  • ... and 144 more: https://git.openjdk.java.net/jdk/compare/5cee23a9ed0b7fe2657be7492d9c1f78fcd02ebf...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 (@seanjmullan) 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).

@turbanoff
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 22, 2021
@openjdk
Copy link

openjdk bot commented Jun 22, 2021

@turbanoff
Your change (at version 1168936) is now ready to be sponsored by a Committer.

@stsypanov
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 23, 2021

@stsypanov Only Committers are allowed to sponsor changes.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 22, 2021

@turbanoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@AlanBateman
Copy link
Contributor

@seanjmullan Are you planning to sponsor this?

@seanjmullan
Copy link
Member

@seanjmullan Are you planning to sponsor this?

Yes, I can do that, but I will wait until Monday in case there are any post-integration issues that I need to follow up on.

@seanjmullan
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 26, 2021

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 26, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and 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 Jul 26, 2021
@openjdk
Copy link

openjdk bot commented Jul 26, 2021

@seanjmullan @turbanoff Pushed as commit b8f79a7.

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

@turbanoff turbanoff deleted the avoid-unnecessary-vector-usage-in-jarindex branch September 15, 2021 07:31
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 security security-dev@openjdk.org
5 participants