On Wed, 17 Dec 2025 22:19:44 GMT, Chen Liang <[email protected]> wrote:

>> Dan Smith has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Factor out reflection code to run just once
>
> make/jdk/src/classes/build/tools/taglet/JSpec.java line 188:
> 
>> 186:         try {
>> 187:             Class<?> c = 
>> Class.forName("jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter");
>> 188:             ThreadLocal<?> tl = (ThreadLocal<?>) 
>> c.getField("CURRENT_PATH").get(null);
> 
> I hope the performance overhead of repeated reflective lookup is 
> acceptable... Ideally we should keep the `Field` in a static final variable.

Ok, fair point (although n is fairly small). Pushed an update that caches the 
ThreadLocal in a static field.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28878#discussion_r2629146943

Reply via email to