Please review a fix for javadoc such that it will follow redirected URLs, including http: to https:, for URLs given on the command line with -link.

An unconditional warning is given if it is found that a URL is redirected.

The change is in Extern.java, with the primary change being the addition of a new method `open(URL)` that allows redirection and generates the warning message.  The other changes are cosmetic cleanup, partly to aggregate some URL handling methods together at the end of the file, and partly to follow IDE suggestions.

The bigger part of the work is a new test, with two test cases.

The first test case is a "real world" test case that uses docs.oracle.com if it is available.  Running this test case may require proxies to be set in order to work as intended. The test checks if the site can be accessed, and skips the test case if not.

The second case sets up two transient webservers, with an HttpServer that redirects all requests to an HttpsServer. The test case uses SSL credentials used in similar tests in the main test/jdk test suite. This test case is always enabled. The test case verifies that the warning message is generated as expected and that the generated files do -not- use the redirected URLs. This is to avoid baking in an assumption that all the files will be redirected. In other words, the redirection is only used for reading the element-list or package-list files.

JBS: https://bugs.openjdk.java.net/browse/JDK-8190312
Webrev: http://cr.openjdk.java.net/~jjg/8190312/webrev.00/

-- Jon

Reply via email to