Skip to content

8383909: Unused ThreadDumper.BoundedByteArrayOutputStream.write(int b) is wrong#31056

Open
benjaminp wants to merge 3 commits intoopenjdk:masterfrom
benjaminp:BoundedByteArrayOutputStream
Open

8383909: Unused ThreadDumper.BoundedByteArrayOutputStream.write(int b) is wrong#31056
benjaminp wants to merge 3 commits intoopenjdk:masterfrom
benjaminp:BoundedByteArrayOutputStream

Conversation

@benjaminp
Copy link
Copy Markdown
Contributor

@benjaminp benjaminp commented May 6, 2026

The condition to bound output length was inverted.



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-8383909: Unused ThreadDumper.BoundedByteArrayOutputStream.write(int b) is wrong (Bug - P5)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31056

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 6, 2026

👋 Welcome back benjaminp! 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
Copy Markdown

openjdk Bot commented May 6, 2026

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

8383909: Unused ThreadDumper.BoundedByteArrayOutputStream.write(int b) is wrong

Reviewed-by: alanb

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 1 new commit pushed to the master branch:

  • b337599: 8383810: Shenandoah: Simplify native CAS barriers

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 (@AlanBateman, @plummercj) 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 core-libs core-libs-dev@openjdk.org label May 6, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

@benjaminp 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 rfr Pull request is ready for review label May 6, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 6, 2026

Webrevs

@AlanBateman
Copy link
Copy Markdown
Contributor

/label remove core-libs
/label add serviceability

@openjdk openjdk Bot removed the core-libs core-libs-dev@openjdk.org label May 6, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

@AlanBateman
The core-libs label was successfully removed.

@openjdk openjdk Bot added serviceability serviceability-dev@openjdk.org and removed rfr Pull request is ready for review labels May 6, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

@AlanBateman
The serviceability label was successfully added.

@openjdk openjdk Bot changed the title 8383909: Unused Threadumper.BoundedByteArrayOutputStream.write(int b) is wrong 8383909: Unused ThreaDumper.BoundedByteArrayOutputStream.write(int b) is wrong May 6, 2026
@openjdk openjdk Bot added the rfr Pull request is ready for review label May 6, 2026
Copy link
Copy Markdown
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

An oversight in the original implementation. Not noticed as specifying the file name as "-" is not documented and the 1-arg write is probably never used

(This code will go away if/when JDK-8336723 is implemented and a supported/documented means to write the thread dump to stdout is added)

@Override
public void write(int b) {
if (max < count) {
if (max > count) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be mildly better to use if (count < max).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 6, 2026
Copy link
Copy Markdown
Contributor

@plummercj plummercj left a comment

Choose a reason for hiding this comment

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

The CR summary needs to be fixed: ThreaDumper -> ThreadDumper

@benjaminp
Copy link
Copy Markdown
Contributor Author

Thanks for noticing. Could someone update the JIRA title? I don't have access.

@benjaminp benjaminp changed the title 8383909: Unused ThreaDumper.BoundedByteArrayOutputStream.write(int b) is wrong 8383909: Unused ThreadDumper.BoundedByteArrayOutputStream.write(int b) is wrong May 6, 2026
@openjdk openjdk Bot removed the ready Pull request is ready to be integrated label May 6, 2026
@plummercj
Copy link
Copy Markdown
Contributor

Thanks for noticing. Could someone update the JIRA title? I don't have access.

Done!

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants