8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId #93
Conversation
👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into |
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()} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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().
@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:
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
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this 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.
/integrate |
Going to push as commit dc4edd3.
Your commit was automatically rebased without conflicts. |
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
Issue
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