RFR: 8318106: Generated HTML for snippet does not always contain an id
Chen Liang
liach at openjdk.org
Thu Jul 11 14:52:55 UTC 2024
On Thu, 11 Jul 2024 14:07:39 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
> Please review this jdk24 bug, which we intend to backport to jdk23 before RDP2, which is a week away. This is a simple fix, but it disturbs multiple tests.
>
> Here's a tip for reviewing. Sometimes a snippet id in a test ends up with `()1`, other times with `()2`. This is because the same snippet may appear more than once on the same page, and we are always looking for its last appearance. For example, if a snippet resides in the first sentence of a method documentation, that snippet will appear in both the "Method Summary" and "Method Details" sections. Otherwise, it will only appear in "Method Details". Appearances are numbered starting from 1 and increment by 1 from top ("Method Summary") to bottom ("Method Details").
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java line 619:
> 617: } else {
> 618: // utmost unexpected, but this case shouldn't fail
> 619: id += "unknown-element-";
Feels weird that unknown element has a `-` between name and count but the others don't.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20136#discussion_r1674138376
More information about the javadoc-dev
mailing list