-
Bug
-
Resolution: Fixed
-
P4
-
15
-
b18
-
x86_64
-
windows_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8310250 | 17.0.10-oracle | Pavel Rappo | P4 | Resolved | Fixed | b04 |
JDK-8308265 | 17.0.8 | Christoph Langer | P4 | Resolved | Fixed | b04 |
JDK-8313885 | 11.0.21 | Paul Hohensee | P4 | Resolved | Fixed | b02 |
OS: Generic
java -version:
openjdk version "15-ea" 2020-09-15
OpenJDK Runtime Environment (build 15-ea+27-1372)
OpenJDK 64-Bit Server VM (build 15-ea+27-1372, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
javadoc generates invalid HTML pages, if java source files have ftp:// links.
The link is translated into a relative path as follows:
java source file:
<a href="ftp://www.domain.com/">FTP Site</a>
generated page:
<a href="../a/ftp://www.domain.com">FTP Site</a>
The issue has reported in
These errors may be included in the Java API documents in the future.
It's a waste of time to modify the source every time a problem is found,
that I would like to suggest the fix.
The problem is that HtmlDocletWriter only checks certain tagas, mailto, http, https, and file.
Regular expressions should be used to support all protocols.
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
@@ -1623,11 +1623,7 @@ public class HtmlDocletWriter {
if (redirectPathFromRoot == null) {
return text;
}
- String lower = Utils.toLowerCase(text);
- if (!(lower.startsWith("mailto:")
- || lower.startsWith("http:")
- || lower.startsWith("https:")
- || lower.startsWith("file:"))) {
+ if (!text.matches("^[^:/?#]+:.+$")) {
text = "{@" + (new DocRootTaglet()).getName() + "}/"
+ redirectPathFromRoot.resolve(text).getPath();
text = replaceDocRootDir(text);
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. unzip attached JavadocTest.zip
I will send it later.
2. execute javadoc
cd JavadocTest
javadoc -J-Duser.language=us -d doc -notimestamp -use a
3. check generated doc/a/package-use.html, doc/a/class-use/B1.StaticInnerB1.html
and doc/index-all.html.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The link should be translated into an absolute path:
<a href="ftp://www.domain.com">FTP Site</a>
ACTUAL -
The link becomes a relative path:
<a href="../a/ftp://www.domain.com">FTP Site</a>
---------- BEGIN SOURCE ----------
I can send JavadocTest.zip as a test case.
---------- END SOURCE ----------
FREQUENCY : occasionally
- backported by
-
JDK-8308265 javadoc generates invalid HTML pages whose ftp:// links are broken
- Resolved
-
JDK-8310250 javadoc generates invalid HTML pages whose ftp:// links are broken
- Resolved
-
JDK-8313885 javadoc generates invalid HTML pages whose ftp:// links are broken
- Resolved
- relates to
-
JDK-5044953 ftp:// links are broken on class-use page
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/f5f17ec7
-
Commit openjdk/jdk17u-dev/bcb1f86d
-
Commit openjdk/jdk/bb95dda0
-
Review openjdk/jdk11u-dev/2002
-
Review openjdk/jdk17u-dev/1236
-
Review openjdk/jdk/5198
-
Review(master) openjdk/jdk8u-dev/420