mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8006228: Doclint doesn't detect <code> {@code nested inline} </code>
Reviewed-by: darcy
This commit is contained in:
parent
e942cdde81
commit
7b493a180e
4 changed files with 22 additions and 1 deletions
|
@ -556,7 +556,7 @@ public class Checker extends DocTreeScanner<Void, Void> {
|
||||||
if (tree.getKind() == DocTree.Kind.CODE) {
|
if (tree.getKind() == DocTree.Kind.CODE) {
|
||||||
for (TagStackItem tsi: tagStack) {
|
for (TagStackItem tsi: tagStack) {
|
||||||
if (tsi.tag == HtmlTag.CODE) {
|
if (tsi.tag == HtmlTag.CODE) {
|
||||||
env.messages.warning(HTML, tree, "dc.tag.nested.not.allowed", "code");
|
env.messages.warning(HTML, tree, "dc.tag.code.within.code");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ dc.no.alt.attr.for.image = no "alt" attribute for image
|
||||||
dc.no.summary.or.caption.for.table=no summary or caption for table
|
dc.no.summary.or.caption.for.table=no summary or caption for table
|
||||||
dc.param.name.not.found = @param name not found
|
dc.param.name.not.found = @param name not found
|
||||||
dc.ref.not.found = reference not found
|
dc.ref.not.found = reference not found
|
||||||
|
dc.tag.code.within.code = '{@code'} within <code>
|
||||||
dc.tag.empty = empty <{0}> tag
|
dc.tag.empty = empty <{0}> tag
|
||||||
dc.tag.end.not.permitted = invalid end tag: </{0}>
|
dc.tag.end.not.permitted = invalid end tag: </{0}>
|
||||||
dc.tag.end.unexpected = unexpected end tag: </{0}>
|
dc.tag.end.unexpected = unexpected end tag: </{0}>
|
||||||
|
|
16
langtools/test/tools/doclint/LiteralTest.java
Normal file
16
langtools/test/tools/doclint/LiteralTest.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* @test /nodynamiccopyright/
|
||||||
|
* @bug 8006228
|
||||||
|
* @summary Doclint doesn't detect <code> {@code nested inline} </code>
|
||||||
|
* @build DocLintTester
|
||||||
|
* @run main DocLintTester -ref LiteralTest.out LiteralTest.java
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public class LiteralTest {
|
||||||
|
/** <code> abc {@literal < & > } def </code> */
|
||||||
|
public void ok_literal_in_code() { }
|
||||||
|
|
||||||
|
/** <code> abc {@code < & > } def </code> */
|
||||||
|
public void bad_code_in_code() { }
|
||||||
|
}
|
4
langtools/test/tools/doclint/LiteralTest.out
Normal file
4
langtools/test/tools/doclint/LiteralTest.out
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
LiteralTest.java:14: warning: {@code} within <code>
|
||||||
|
/** <code> abc {@code < & > } def </code> */
|
||||||
|
^
|
||||||
|
1 warning
|
Loading…
Add table
Add a link
Reference in a new issue