Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId #93

Closed
wants to merge 4 commits into from

Conversation

egahlin
Copy link
Member

@egahlin egahlin commented Jun 29, 2022

Could I have a review of PR that changes documentation from the now deprecated method Thread.getId() to the new Thread.threadId().

I also fixed a typo, where it said "The Java thread". Should be "the OS thread".

Testing: 'make docs' and inspect the result

Thanks
Erik


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-8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 93

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/93.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 29, 2022

👋 Welcome back egahlin! 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 Jun 29, 2022

@egahlin The following label will be automatically applied to this pull request:

  • hotspot-jfr

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 hotspot-jfr hotspot-jfr-dev@openjdk.org label Jun 29, 2022
@egahlin egahlin marked this pull request as ready for review June 29, 2022 21:34
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 29, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 29, 2022

Webrevs

@@ -97,7 +97,7 @@ public long getJavaThreadId() {
* reused within the lifespan of the JVM.
* <p>
* See {@link #getJavaThreadId()} for the ID that is returned by
* {@code java.lang.Thread.getId()}
* {@code java.lang.Thread.threadId()}

Choose a reason for hiding this comment

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

Looks okay but maybe it should be a link?

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered it, but the purpose of the comment is to help users not mix up getId() with getJavaThreadId() in the RecordedThread class. If users follows a link to java.lang.Thread and read about the two IDs there, it might confuse them. The difference between getId() and threadId() in j.l.Thread is not the same as in RecordedThread.

That said, if you think a link would be helpful I can add it.

Choose a reason for hiding this comment

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

It might help to have "Java thread ID" in the RecordedThread::getThreadId descriptoin link to Thread::threadId. For RecordedThread::getId then maybe it just needs a @see #getThreadId() with no reference or link to j.l.Thread methods. But up to you, I don't have a strong opinion on this except that developers using this API understand that consuming a recording means dealing with non-Java threads and they have an ID too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I added a link Thread::threadId() to RecordedThread::getJavaThreadId(), but didn't link RecordedThread::getId(). I also added a link to getOSThreadId() from getId().

@openjdk
Copy link

openjdk bot commented Jun 30, 2022

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

8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId

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

  • 9549777: 8284358: Unreachable loop is not removed from C2 IR, leading to a broken graph
  • c20b3aa: 8289278: Suspend/ResumeAllVirtualThreads need both can_suspend and can_support_virtual_threads

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.

➡️ 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 Pull request is ready to be integrated label Jun 30, 2022
Copy link

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

This looks okay to me.

@egahlin
Copy link
Member Author

egahlin commented Jul 3, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Jul 3, 2022

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

  • c4dcce4: 8289619: JVMTI SelfSuspendDisablerTest.java failed with RuntimeException: Test FAILED: Unexpected thread state
  • f5cdaba: 8245268: -Xcomp is missing from java launcher documentation
  • 9515560: 8288703: GetThreadState returns 0 for virtual thread that has terminated
  • cfc9a88: 8288854: getLocalGraphicsEnvironment() on for multi-screen setups throws exception NPE
  • 9925014: 8280320: C2: Loop opts are missing during OSR compilation
  • 8e01ffb: 8289570: SegmentAllocator:allocateUtf8String(String str) default behavior mismatch to spec
  • 20124ac: 8289585: ProblemList sun/tools/jhsdb/JStackStressTest.java on linux-aarch64
  • 604ea90: 8289549: ISO 4217 Amendment 172 Update
  • 9549777: 8284358: Unreachable loop is not removed from C2 IR, leading to a broken graph
  • c20b3aa: 8289278: Suspend/ResumeAllVirtualThreads need both can_suspend and can_support_virtual_threads

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 3, 2022
@openjdk openjdk bot closed this Jul 3, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 3, 2022
@openjdk
Copy link

openjdk bot commented Jul 3, 2022

@egahlin Pushed as commit dc4edd3.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated
2 participants