-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b156
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174508 | 10 | Kumar Srinivasan | P3 | Resolved | Fixed | b01 |
Following a changeset earlier this week, there are now no doclint errors being reported against 3 of the 15 JDK doc bundles:
docs/jdk/api/javac/tree/index.html
docs/jdk/api/javadoc/doclet/index.html
docs/jdk/api/javadoc/taglet/index.html
Therefore, it becomes interesting to run tidy on the files in these directories, to see if tidy reports any errors.
If it reports errors, that would seem to indicate either problems in the javadoc tool, or in doclint for not reporting issues in user comments.
So, I tried that, and found errors! 5 to be exact, but I think they are all derivatives of one basic error.
The problem seems to be in the way javadoc is processing a user comment. But the comment appears to be legal.
Here's the doc comment. It's on a nested enum in langtools/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java
/**
* Lambda expressions come in two forms:
* <ul compact>
* <li> expression lambdas, whose body is an expression, and
* <li> statement lambdas, whose body is a block
* </ul>
*/
@jdk.Exported
public enum BodyKind {
/** enum constant for expression lambdas */
EXPRESSION,
/** enum constant for statement lambdas */
STATEMENT
}
The issue is that <ul> tag.
The comment is being processed correctly for the doc page for the enum itself
<div class="block">Lambda expressions come in two forms:
<ul compact>
<li> expression lambdas, whose body is an expression, and
<li> statement lambdas, whose body is a block
</ul></div>
But look at it in the Nested Class summary for the enclosing page ... the <li> and the closing </ul> have been removed:
<div class="block">Lambda expressions come in two forms:
<ul compact>
expression lambdas, whose body is an expression, and
statement lambdas, whose body is a block
</div>
All 5 errors are effectively equivalent, so I assume the (incorrect) summary is being written into multiple pages.
---
Problem appears to be in HtmlDocletWriter.removeNonInlineHtmlTags. The loop round about line 1772 is not allowing for the possibility of attributes, and so tags with attributes are (incorrectly) allowed through, meaning that "<ul compact>" is not filtered out, but its closing tag "</ul>" is.
docs/jdk/api/javac/tree/index.html
docs/jdk/api/javadoc/doclet/index.html
docs/jdk/api/javadoc/taglet/index.html
Therefore, it becomes interesting to run tidy on the files in these directories, to see if tidy reports any errors.
If it reports errors, that would seem to indicate either problems in the javadoc tool, or in doclint for not reporting issues in user comments.
So, I tried that, and found errors! 5 to be exact, but I think they are all derivatives of one basic error.
The problem seems to be in the way javadoc is processing a user comment. But the comment appears to be legal.
Here's the doc comment. It's on a nested enum in langtools/src/share/classes/com/sun/source/tree/LambdaExpressionTree.java
/**
* Lambda expressions come in two forms:
* <ul compact>
* <li> expression lambdas, whose body is an expression, and
* <li> statement lambdas, whose body is a block
* </ul>
*/
@jdk.Exported
public enum BodyKind {
/** enum constant for expression lambdas */
EXPRESSION,
/** enum constant for statement lambdas */
STATEMENT
}
The issue is that <ul> tag.
The comment is being processed correctly for the doc page for the enum itself
<div class="block">Lambda expressions come in two forms:
<ul compact>
<li> expression lambdas, whose body is an expression, and
<li> statement lambdas, whose body is a block
</ul></div>
But look at it in the Nested Class summary for the enclosing page ... the <li> and the closing </ul> have been removed:
<div class="block">Lambda expressions come in two forms:
<ul compact>
expression lambdas, whose body is an expression, and
statement lambdas, whose body is a block
</div>
All 5 errors are effectively equivalent, so I assume the (incorrect) summary is being written into multiple pages.
---
Problem appears to be in HtmlDocletWriter.removeNonInlineHtmlTags. The loop round about line 1772 is not allowing for the possibility of attributes, and so tags with attributes are (incorrectly) allowed through, meaning that "<ul compact>" is not filtered out, but its closing tag "</ul>" is.
- backported by
-
JDK-8174508 javadoc strips HTML incorrectly; causes invalid generated HTML files
-
- Resolved
-
- relates to
-
JDK-8174715 Javadoc fails on JDK 7 and JDK 8 sources with StringIndexOutOfBoundsException
-
- Closed
-