On Fri, 6 Mar 2026 18:07:14 GMT, Hannes Wallnöfer <[email protected]> wrote:

> Please review an enhancement that adds a new default `toString` method to the 
> `jdk.javadoc.doclet.Taglet` interface which receives the path to the 
> documentation root directory as additional argument of type `java.net.URI`. 
> (The initial version of this PR used `java.nio.file.Path` which was of course 
> a blunder as that class uses a platform-dependent separator.)
> 
> This makes it possible to create correct relative URLs when a tag is rendered 
> outside of its element's resource (such as in a summary page), which was 
> previously impossible using the public Taglet API. It also makes it easier to 
> build relative URLs in the common case where a tag is rendered in its 
> element's normal location.
> 
> I also added the changes for 
> [JDK-8379520](https://bugs.openjdk.org/browse/JDK-8379520) to make use of the 
> new API in JDK build Taglets to this PR. The changes to the `JSpec` and 
> `ToolGuide` taglets consist in undoing the changes from 
> [JDK-8373909](https://bugs.openjdk.org/browse/JDK-8373909) and replacing it 
> with the new functionality. 
> 
> For `SealedGraph` it's a bit more involved, because in order to be able to 
> use the `pathToRoot` URI I had to change the naming of .svg files for nested 
> classes to not use subdirectories for enclosing classes so that these files 
> use the same directory as all the other files from that package.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 35ad47b4
Author:    Hannes Wallnöfer <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/35ad47b4c09d0812f3f7c57ac7932c1533790fc1
Stats:     406 lines in 9 files changed: 308 ins; 61 del; 37 mod

8373922: Enhance Taglet API to support relative URLs
8379520: Make use of new Taglet.toString method in JDK build taglets

Reviewed-by: liach

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

PR: https://git.openjdk.org/jdk/pull/30120

Reply via email to