RFR (S): 8217773: Test langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java fails after JDK-8217034

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Jan 25 23:38:11 UTC 2019


Christoph, and other javadoc Reveiwers,

Thanks again for reporting the problem. It went unnoticed here because 
it is not common to run tests with proxy access through the corporate 
firewall, and this test quietly skips one of its subtests when it cannot 
access an external resource. I was able to reproduce your results by 
running the test with proxies set up.

There are two possible fixes to the problem. One is to disable the 
"missing file" check, and the other to to change the name of the target 
in the link to a nearby file that does exist.  Here are the two patches,

::::::::::::::
fix1.patch
::::::::::::::
diff -r 090395557398 
test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java
--- 
a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java 
Fri Jan 25 14:28:43 2019 -0800
+++ 
b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java 
Fri Jan 25 15:13:43 2019 -0800
@@ -116,6 +116,7 @@

          String apiURL = 
"http://docs.oracle.com/en/java/javase/11/docs/api";
          String outRedirect = "outRedirect";
+        setAutomaticCheckLinks(false); // The example code has toy/bad 
links
          javadoc("-d", outRedirect,
                  "-html4",
                  "-sourcepath", testSrc,
@@ -128,6 +129,7 @@
          checkOutput("pkg/C.html", true,
                  "<a href=\"" + apiURL + 
"/java.base/java/lang/Object.html?is-external=true\" "
                          + "title=\"class or interface in java.lang\" 
class=\"externalLink\">Object</a>");
+        setAutomaticCheckLinks(true); // re-enable checks
      }

      private Path libApi = Path.of("libApi");
::::::::::::::
fix2.patch
::::::::::::::
diff -r 090395557398 
test/langtools/jdk/javadoc/doclet/testLinkOption/pkg/B.java
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/pkg/B.java Fri 
Jan 25 14:28:43 2019 -0800
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/pkg/B.java Fri 
Jan 25 15:15:18 2019 -0800
@@ -60,7 +60,7 @@
      * Resource Identifiers (URI): Generic Syntax</i></a>, <br><a
      * href="http://www.ietf.org/rfc/rfc2732.txt"><i>RFC 2732: 
Format for
      * Literal IPv6 Addresses in URLs</i></a>, <br><a
-    * href="URISyntaxException.html">URISyntaxException</a>
+    * href="C.html">A nearby file</a>
      */
     public void externalLink() {}
  }


Of the two, I prefer the second on principle, because having worked to 
enable automatic link checking as much as possible, I don't like 
disabling it anywhere. The one wrinkle here is that the change impacts 
another test in the same directory, but that one is easy to fix up, and 
to then enable the link checking in that part of that test.  That 
additional fix is included in the webrev.

http://cr.openjdk.java.net/~jjg/8217773/webrev.00/

-- Jon



On 01/25/2019 08:30 AM, Jonathan Gibbons wrote:
>
> Christoph,
>
> Thanks for reporting the problem.
>
> The issue may be real, but at first glance, your fix looks incorrect. 
> The test is specifically about testing a "<a href...>" and so it is 
> incorrect to replace it to the more conventional "@see ..." tag.
>
> I will investigate in more detail later today.
>
> -- Jon
>
> On 1/25/19 12:10 AM, Langer, Christoph wrote:
>>
>> Hi,
>>
>> it seems that after JDK-8217034, the test 
>> langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java is 
>> broken. The fix looks trivial, please review:
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8217773
>>
>> Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8217773.0/ 
>> <http://cr.openjdk.java.net/%7Eclanger/webrevs/8217773.0/>
>>
>> Thanks
>>
>> Christoph
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/javadoc-dev/attachments/20190125/fc43f6cd/attachment.html>


More information about the javadoc-dev mailing list