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
Contributor

@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 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.

Loading

@openjdk
Copy link

@openjdk 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.

Loading

@openjdk openjdk bot added the core-libs 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

@AlanBateman AlanBateman commented Jun 14, 2021

/label add security

Loading

@openjdk openjdk bot added the security label Jun 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 14, 2021

@AlanBateman
The security label was successfully added.

Loading

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

@mbien mbien Jun 15, 2021

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 ;)

Loading

Copy link
Contributor Author

@turbanoff turbanoff Jun 16, 2021

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.

Loading

@stsypanov
Copy link
Contributor

@stsypanov stsypanov commented Jun 16, 2021

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

Loading

@turbanoff
Copy link
Contributor Author

@turbanoff turbanoff commented Jun 16, 2021

/issue 8268873

Loading

@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 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.

Loading

@openjdk openjdk bot added the rfr label Jun 16, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 16, 2021

Webrevs

Loading

Copy link
Member

@seanjmullan seanjmullan left a comment

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

Loading

@openjdk
Copy link

@openjdk 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).

Loading

@turbanoff
Copy link
Contributor Author

@turbanoff turbanoff commented Jun 22, 2021

/integrate

Loading

@openjdk openjdk bot added the sponsor label Jun 22, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 22, 2021

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

Loading

@stsypanov
Copy link
Contributor

@stsypanov stsypanov commented Jun 23, 2021

/sponsor

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@stsypanov Only Committers are allowed to sponsor changes.

Loading

@bridgekeeper
Copy link

@bridgekeeper 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!

Loading

@AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Jul 23, 2021

@seanjmullan Are you planning to sponsor this?

Loading

@seanjmullan
Copy link
Member

@seanjmullan seanjmullan commented Jul 23, 2021

@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.

Loading

@seanjmullan
Copy link
Member

@seanjmullan seanjmullan commented Jul 26, 2021

/sponsor

Loading

@openjdk
Copy link

@openjdk 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.

Loading

@openjdk
Copy link

@openjdk 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.

Loading

@turbanoff turbanoff deleted the avoid-unnecessary-vector-usage-in-jarindex branch Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants