RFR: 8248001: javadoc generates invalid HTML pages whose ftp:// links are broken [v2]

Hannes Wallnöfer hannesw at openjdk.java.net
Thu Sep 30 09:08:33 UTC 2021


On Mon, 27 Sep 2021 08:53:50 GMT, Masanori Yano <myano at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java line 1706:
>> 
>>> 1704:                 || lower.startsWith("https:")
>>> 1705:                 || lower.startsWith("file:")
>>> 1706:                 || lower.startsWith("ftp:")) {
>> 
>> Adding `ftp:` is OK, but given that the method is about modifying relative URLs, a reasonable/preferable alternative would be to use `URI.isAbsolute`
>> 
>> If a `URISyntaxException` occurs while creating the URI, I would suggest it should simply `return text` and not try and modify the text.
>
> @jonathan-gibbons Could you reply to the above comment?

@masyano I think it's ok this way. After all, this is a simple bug and we have spent more than enough time on bike-shedding. If we want to improve the mechanism by using `java.net.URI` we can file a separate issue for it.

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

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


More information about the javadoc-dev mailing list