-
Bug
-
Resolution: Unresolved
-
P3
-
9
The body of @deprecated is put into a <span>, which can lead to invalid HTML if the body contains HTML block-level elements, such as <p> or <pre>. See, for example, these error messages, reporting the presence of <div> in a <span>
$ tidy -e -q --gnu-emacs true $(find $(find build/linux-x86_64-normal-server-release/images/docs -name naming) -name \*.html)
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:445:20: Warning: missing </span> before <pre>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:460:15: Warning: discarding unexpected </span>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:1213:74: Warning: missing </span> before <pre>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:1228:15: Warning: discarding unexpected </span>
Somewhat related, the entire body of the @deprecated tag is put into the summary, and not just the first sentence, as indicated in the spec.
See, for example, both occurrences of APPLET in this page:
http://download.java.net/java/jdk9/docs/api/javax/naming/Context.html
The following spec page
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html
says
---8<----
@deprecated deprecated-text
Introduced in JDK 1.0
Adds a comment indicating that this API should no longer be used (even though it may continue to work). The javadoc command moves deprecated-text ahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field.
The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement. The javadoc command copies the first sentence to the summary section and index. Subsequent sentences can also explain why it was deprecated. You should include an {@link} tag (for Javadoc 1.2 or later) that points to the replacement API.
--->8----
Note in that description: The javadoc command copies the first sentence to the summary section and index.
$ tidy -e -q --gnu-emacs true $(find $(find build/linux-x86_64-normal-server-release/images/docs -name naming) -name \*.html)
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:445:20: Warning: missing </span> before <pre>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:460:15: Warning: discarding unexpected </span>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:1213:74: Warning: missing </span> before <pre>
build/linux-x86_64-normal-server-release/images/docs/api/javax/naming/Context.html:1228:15: Warning: discarding unexpected </span>
Somewhat related, the entire body of the @deprecated tag is put into the summary, and not just the first sentence, as indicated in the spec.
See, for example, both occurrences of APPLET in this page:
http://download.java.net/java/jdk9/docs/api/javax/naming/Context.html
The following spec page
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html
says
---8<----
@deprecated deprecated-text
Introduced in JDK 1.0
Adds a comment indicating that this API should no longer be used (even though it may continue to work). The javadoc command moves deprecated-text ahead of the main description, placing it in italics and preceding it with a bold warning: Deprecated. This tag is valid in all documentation comments: overview, package, class, interface, constructor, method and field.
The first sentence of deprecated text should tell the user when the API was deprecated and what to use as a replacement. The javadoc command copies the first sentence to the summary section and index. Subsequent sentences can also explain why it was deprecated. You should include an {@link} tag (for Javadoc 1.2 or later) that points to the replacement API.
--->8----
Note in that description: The javadoc command copies the first sentence to the summary section and index.
- relates to
-
JDK-8183511 improve style for deprecated text
-
- Resolved
-