RFR: 8220002: Improve anchor definitions in generated files

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Jan 10 01:10:38 UTC 2020

Generally wonderful (i.e generally approved.)

I like the new HtmlTree.setId method and the fluent use at most use 
sites. There were a couple of places that did not use fluent invocation, 
that easily could be updated, but that's not a big deal.  I also like 
the amount of anchor-related code that got simplified or removed.

I'm not entirely convinced the new HtmlTree.SPAN_ID carries it's own 
weight: I agree it is a natural conversion from the previous A_ID, but 
it seems that in some places the id could have been moved onto an 
enclosing node. Not a big deal at this time, especially as changing this 
would affect tests.

There are some places/changes with questionable code, but it was never 
new questionable code; it was code that was previously questionable that 
was being updated or moved.  Now is not really the time to clean stuff 
like that up.

I looked at the generated docs, scanning for instances of "<section". 
Very nice!

-- Jon

On 01/08/2020 03:31 AM, Hannes Wallnöfer wrote:
> Please review:
> JBS: https://bugs.openjdk.java.net/browse/JDK-8220002
> Webrev: http://cr.openjdk.java.net/~hannesw/8220002/webrev.01/
> API docs: http://cr.openjdk.java.net/~hannesw/8220002/api.01/
> In places where a <section> tag is available I always moved the id attribute there instead of the heading. This required a bit more changes in some places, but was necessary to get the anchoring position right (see for example the section and individual member anchors in type pages, both of which are now just right IMO).
> This patch should cover all occurrences of <a id=…> tags in generated docs, but there are still dozens in static HTML files. I’ll file a separate issue for those.
> Hannes

More information about the javadoc-dev mailing list