RFR: JDK-8250768: javac should be adapted to changes in JEP 12

Jan Lahoda jlahoda at openjdk.java.net
Mon Oct 19 14:52:14 UTC 2020

On Mon, 19 Oct 2020 14:22:17 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java line 2238:
>>> 2236:             if (previewTree != null) {
>>> 2237:                 previewDiv.add(new HtmlTree(TagName.A).put(HtmlAttr.ID, "preview")
>>> 2238:                                                       .add(new
>>> RawHtml(utils.getPreviewTreeSummaryOrDetails(previewTree, false))));
>> The `id` attribute needs to be unique within the page, so in addition to make the value not a valid java identifier (as
>> @jonathan-gibbons pointed out in a comment elsewhere) we need to support multiple preview ids per page. One way to do
>> this would be to add the element name to the id value, e.g. `preview-<element name>`.
> Of course the element name won't do for overloaded methods and constructors... `Links#getAnchor(ExecutableElement)`
> should be used for those.

Uh, originally, there was only preview section per file, and I didn't fully realize the JDK's javadoc may have multiple
such section. I'll work on this. Thanks for the pointer!


PR: https://git.openjdk.java.net/jdk/pull/703

More information about the compiler-dev mailing list