[jdk19] RFR: 8289183: jdk.jfr.consumer.RecordedThread.getId references Thread::getId, should be Thread::threadId

Erik Gahlin egahlin at openjdk.org
Thu Jun 30 07:30:42 UTC 2022


On Thu, 30 Jun 2022 06:08:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> 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
>
> src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java line 100:
> 
>> 98:      * <p>
>> 99:      * See {@link #getJavaThreadId()} for the ID that is returned by
>> 100:      * {@code java.lang.Thread.threadId()}
> 
> Looks okay but maybe it should be a link?

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.

-------------

PR: https://git.openjdk.org/jdk19/pull/93


More information about the hotspot-jfr-dev mailing list