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

8283711: Remove redundant 'new String' calls after concatenation #7876

Closed

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Mar 20, 2022

Result of string concatenation is a newly created String object. There is no need it wrap it in another 'new String' call.
Such calls are confusing and produce warnings in IDE. Without them code is easier to read.
Similar cleanup JDK-8273375 in java.desktop


Progress

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

Issue

  • JDK-8283711: Remove redundant 'new String' calls after concatenation

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7876

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 20, 2022

👋 Welcome back aturbanov! 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 20, 2022

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

  • compiler
  • security

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 security compiler labels Mar 20, 2022
@turbanoff turbanoff changed the title [PATCH] Remove redundant 'new String' calls after concatenation 8283711: Remove redundant 'new String' calls after concatenation Mar 25, 2022
@openjdk openjdk bot added the rfr label Mar 25, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 25, 2022

Webrevs

Copy link
Contributor

@bradfordwetmore bradfordwetmore left a comment

LGTM.

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

the compiler changes looks good

@openjdk
Copy link

openjdk bot commented Mar 25, 2022

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

8283711: Remove redundant 'new String' calls after concatenation

Reviewed-by: wetmore, vromero, xuelei

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

  • c587b29: 8283720: ProblemList java/time/test/java/time/TestZoneOffset.java
  • d5f9059: 8283695: [AIX] Build failure due to name conflict in test_arguments.cpp
  • f520b4f: 8283668: Update IllegalFormatException to use sealed classes
  • 5ca8b91: 8283713: [BACKOUT] Unexpected TypeElement in ANALYZE TaskEvent
  • 7bac0a8: 8283681: Improve ZonedDateTime offset handling
  • 2600f99: 8282685: fileToEncodedURL_[name|signature] symbols are unused
  • e97cf15: 8283691: Classes in java.security still reference deprecated classes in spec
  • cb012a5: 8283648: Improve the snippet "file not found" message.
  • 36b36ef: 8283661: Unexpected TypeElement in ANALYZE TaskEvent
  • f4fd53d: 8273370: Preferences.exportSubtree() generates invalid XML if value contains control char
  • ... and 79 more: https://git.openjdk.java.net/jdk/compare/4df67426ed02f18af0757897acb28b636a317a91...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 label Mar 25, 2022
Copy link
Member

@XueleiFan XueleiFan left a comment

Good catches!

@turbanoff
Copy link
Member Author

turbanoff commented Mar 28, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Mar 28, 2022

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

  • c0aecd1: 8280400: JDK 19 L10n resource files update - msgdrop 10
  • f0282d7: 8279488: ProcessBuilder inherits contextClassLoader when spawning a process reaper thread
  • a577656: 8282943: Unused weird key in compiler.properties
  • 7f2a3ca: 8281561: Disable http DIGEST mechanism with MD5 and SHA-1 by default
  • 0c472c8: 8283756: (zipfs) ZipFSOutputStreamTest.testOutputStream should only check inflated bytes
  • d6fa8b0: 8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak
  • 8567266: 8283683: Make ThreadLocalRandom a final class
  • f4eaa16: 8283728: jdk.hotspot.agent: Wrong location for RISCV64ThreadContext.java
  • cdef087: 8283727: P11KeyGenerator has import statement with two semicolons after JDK-8267319
  • 7f12537: 8283558: Parallel: Pass PSIsAliveClosure to ReferenceProcessor constructor
  • ... and 92 more: https://git.openjdk.java.net/jdk/compare/4df67426ed02f18af0757897acb28b636a317a91...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Mar 28, 2022
@openjdk openjdk bot closed this Mar 28, 2022
@openjdk openjdk bot removed ready rfr labels Mar 28, 2022
@openjdk
Copy link

openjdk bot commented Mar 28, 2022

@turbanoff Pushed as commit d472c01.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler integrated security
4 participants