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

8264428: Cleanup usages of StringBuffer in java.desktop #3251

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Mar 29, 2021

There are few possible cleanups in java.desktop related to legacy StringBuffer usages:

  1. In few places StringBuffer can be replaced with plain String concatenation.
  2. StringBuffer can be replaced with StringBuilder. StringBuilder has better performance as it is not thread-safe.
  3. There are few places where result of string concatenation is passed to StringBuffer.append method. Using separate .append calls is more clear.
  4. In few places primitives are unnecessary converted to String before .append call. They can be replaced with specialized methods (like .append(int) calls.

Progress

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

Issue

  • JDK-8264428: Cleanup usages of StringBuffer in java.desktop

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3251

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 29, 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 Mar 29, 2021

@turbanoff The following labels will be automatically applied to this pull request:

  • 2d
  • awt
  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added swing client-libs-dev@openjdk.org 2d client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Mar 29, 2021
@shipilev
Copy link
Member

Submitted: https://bugs.openjdk.java.net/browse/JDK-8264428, please rename PR to "8264428: Replace uses of StringBuffer with StringBuilder in java.desktop".

@turbanoff turbanoff changed the title [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop Mar 30, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 30, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 30, 2021

Webrevs

@mrserb
Copy link
Member

mrserb commented Mar 31, 2021

Looks like this change goes beyond of simple replacement of StringBuffer with StringBuilder. Please update the description of the bug and PR description.

@turbanoff turbanoff changed the title 8264428: Replace uses of StringBuffer with StringBuilder in java.desktop 8264428: Cleanup usages of StringBuffer in java.desktop Apr 1, 2021
@turbanoff
Copy link
Member Author

I've updated PR description, but I don't have rights to update JIRA.

@shipilev
Copy link
Member

shipilev commented Apr 1, 2021

I updated the bug synopsis in JIRA.

@openjdk
Copy link

openjdk bot commented Apr 7, 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:

8264428: Cleanup usages of StringBuffer in java.desktop

Reviewed-by: azvegint, aivanov

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

  • 81d35e4: 8264063: Outer Safepoint poll load should not reference the head of inner strip mined loop.
  • 04fa1ed: 8264848: [macos] libjvm.dylib linker warning due to macOS version mismatch
  • 214d6e2: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable
  • af13c64: 8264711: More runtime TRAPS cleanups
  • 3aec2d9: 8264718: Shenandoah: enable string deduplication during root scanning
  • 255afbe: 8264672: runtime/ParallelLoad/ParallelSuperTest.java timed out
  • ec599da: 8264633: Add missing logging to PlatformRecording#stop
  • e89542f: 8264352: AArch64: Optimize vector "not/andNot" for NEON and SVE
  • 016db40: 8263907: Specification of CellRendererPane::paintComponent(..Rectangle) should clearly mention which method it delegates the call to
  • 78d1164: 8214455: Relocate CDS archived regions to the top of the G1 heap
  • ... and 120 more: https://git.openjdk.java.net/jdk/compare/a5d7de235101696463dba22792703c6809ff7fc4...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 (@azvegint, @aivanov-jdk) 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 Apr 7, 2021
…ot.agent

place each 'append' call on its own line
@turbanoff
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 8, 2021

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

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 8, 2021
@azvegint
Copy link
Member

azvegint commented Apr 8, 2021

/sponsor

@openjdk openjdk bot closed this Apr 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 8, 2021
@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@azvegint @turbanoff Since your change was applied there have been 132 commits pushed to the master branch:

  • 308f679: 8264454: Jaxp unit test from open jdk needs to be improved
  • 5bd6c74: 8236127: Use value of --icon CLI option to set icon for exe installers
  • 81d35e4: 8264063: Outer Safepoint poll load should not reference the head of inner strip mined loop.
  • 04fa1ed: 8264848: [macos] libjvm.dylib linker warning due to macOS version mismatch
  • 214d6e2: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable
  • af13c64: 8264711: More runtime TRAPS cleanups
  • 3aec2d9: 8264718: Shenandoah: enable string deduplication during root scanning
  • 255afbe: 8264672: runtime/ParallelLoad/ParallelSuperTest.java timed out
  • ec599da: 8264633: Add missing logging to PlatformRecording#stop
  • e89542f: 8264352: AArch64: Optimize vector "not/andNot" for NEON and SVE
  • ... and 122 more: https://git.openjdk.java.net/jdk/compare/a5d7de235101696463dba22792703c6809ff7fc4...master

Your commit was automatically rebased without conflicts.

Pushed as commit 8a23580.

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

@turbanoff turbanoff deleted the replace_uses_of_StringBuffer_with_StringBuilder_in_java.desktop branch September 15, 2021 07:31
@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2d client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org client client-libs-dev@openjdk.org integrated Pull request has been integrated swing client-libs-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

5 participants