RFR: 8373909: JSpec and ToolGuide taglets use incorrect relative path [v2]

Dan Smith dlsmith at openjdk.org
Thu Dec 18 01:18:30 UTC 2025


On Wed, 17 Dec 2025 22:19:44 GMT, Chen Liang <liach at openjdk.org> 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


More information about the build-dev mailing list