[jdk19] RFR: 8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId [v3]
Erik Gahlin
egahlin at openjdk.org
Fri Jul 1 12:59:43 UTC 2022
On Fri, 1 Jul 2022 08:44:58 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> 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.
>
> 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.
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().
-------------
PR: https://git.openjdk.org/jdk19/pull/93
More information about the hotspot-jfr-dev
mailing list