Skip to content

Conversation

@wenshao
Copy link
Contributor

@wenshao wenshao commented Jul 11, 2024

There are three places in the JDK code where String.format("%n") is used. This is actually equivalent to System.lineSeparator and does not require the implementation of String.format.


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-8336278: Micro-optimize Replace String.format("%n") to System.lineSeparator (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20149

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 11, 2024

👋 Welcome back wenshao! 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 Jul 11, 2024

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

8336278: Micro-optimize Replace String.format("%n") to System.lineSeparator

Reviewed-by: dnsimon, shade

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

  • 1f6e106: 8335684: Test ThreadCpuTime.java should pause like ThreadCpuTimeArray.java
  • 84c74ad: 8335802: Improve startup speed HexFormat uses boolean instead of enum
  • 4f312d6: 8336152: Remove unused forward declaration in classLoadInfo.hpp
  • 34d8562: 8335902: Parallel: Refactor VM_ParallelGCFailedAllocation and VM_ParallelGCSystemGC
  • 2fc7eb4: 8155030: The Menu Mnemonics are always displayed for GTK LAF
  • 559826c: 8332474: Tighten up ToolBox' JavacTask to not silently accept javac crash as a failure
  • eec0e15: 8335619: Add an @APinote to j.l.i.ClassFileTransformer to warn about recursive class loading and ClassCircularityErrors
  • 9b6f6c5: 8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable
  • 7a62032: 8336081: Fix -Wzero-as-null-pointer-constant warnings in JVMTypedFlagLimit ctors
  • f677b90: 8267887: RMIConnector_NPETest.java fails after removal of RMI Activation (JDK-8267123)
  • ... and 2 more: https://git.openjdk.org/jdk/compare/81a0d1ba03bbdbe718302b3925cdc207d5d05232...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 (@dougxc, @shipilev) 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
Copy link

openjdk bot commented Jul 11, 2024

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

  • graal
  • hotspot

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 graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Jul 11, 2024
@wenshao wenshao changed the title Micro-optimize Replace String.format("%n") to System.lineSeparator 8336278: Micro-optimize Replace String.format("%n") to System.lineSeparator Jul 12, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 12, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 12, 2024

Webrevs

Copy link
Member

@dougxc dougxc left a comment

Choose a reason for hiding this comment

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

Looks good and trivial to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 12, 2024
Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Hah! Yes, it makes no sense to call into String.format to just get the line separator.

@wenshao
Copy link
Contributor Author

wenshao commented Jul 12, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 12, 2024
@openjdk
Copy link

openjdk bot commented Jul 12, 2024

@wenshao
Your change (at version 829da3e) is now ready to be sponsored by a Committer.

@liach
Copy link
Member

liach commented Jul 12, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 12, 2024

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

  • 1f6e106: 8335684: Test ThreadCpuTime.java should pause like ThreadCpuTimeArray.java
  • 84c74ad: 8335802: Improve startup speed HexFormat uses boolean instead of enum
  • 4f312d6: 8336152: Remove unused forward declaration in classLoadInfo.hpp
  • 34d8562: 8335902: Parallel: Refactor VM_ParallelGCFailedAllocation and VM_ParallelGCSystemGC
  • 2fc7eb4: 8155030: The Menu Mnemonics are always displayed for GTK LAF
  • 559826c: 8332474: Tighten up ToolBox' JavacTask to not silently accept javac crash as a failure
  • eec0e15: 8335619: Add an @APinote to j.l.i.ClassFileTransformer to warn about recursive class loading and ClassCircularityErrors
  • 9b6f6c5: 8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable
  • 7a62032: 8336081: Fix -Wzero-as-null-pointer-constant warnings in JVMTypedFlagLimit ctors
  • f677b90: 8267887: RMIConnector_NPETest.java fails after removal of RMI Activation (JDK-8267123)
  • ... and 2 more: https://git.openjdk.org/jdk/compare/81a0d1ba03bbdbe718302b3925cdc207d5d05232...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 12, 2024
@openjdk openjdk bot closed this Jul 12, 2024
@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 Jul 12, 2024
@openjdk
Copy link

openjdk bot commented Jul 12, 2024

@liach @wenshao Pushed as commit 4957145.

💡 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

graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants