RFR: JDK-8200337: Generalize see and link tags for user-defined anchors [v6]

Hannes Wallnöfer hannesw at openjdk.org
Mon Oct 31 09:40:28 UTC 2022


On Mon, 31 Oct 2022 09:32:25 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> test/langtools/jdk/javadoc/doclet/testSeeLinkAnchor/TestSeeLinkAnchor.java line 114:
>> 
>>> 112:         checkOrder("m1/module-summary.html",
>>> 113:             """
>>> 114:                     <a href="../m2/com/m2/Class2.html#main-heading"><code>See main heading in Class2</code></a>""");
>> 
>> It seems like an anti-pattern to check the order of a single item!
>> Is this as intended?  Other examples, below, provide pairs.
>
> Admittedly it was not a conscious choice to use `checkOrder` here, but I don't think it is an anti-pattern. Using `checkOrder` for a single string adds no overhead compared to `checkOutput`, and If we ever add additional string I think it is ok to do an ordered check by default.

Looking at the `JavadocTester` source code, I notice that the remaining uses of `checkOutput` are numbered and marked as TODO, which supports the idea that `checkOrder` should be the default.

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

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


More information about the compiler-dev mailing list