提交 f59adebe 编写于 作者: J jjg

8006228: Doclint doesn't detect <code> {@code nested inline} </code>

Reviewed-by: darcy
上级 a5013ea3
......@@ -556,7 +556,7 @@ public class Checker extends DocTreeScanner<Void, Void> {
if (tree.getKind() == DocTree.Kind.CODE) {
for (TagStackItem tsi: tagStack) {
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;
}
}
......
......@@ -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.param.name.not.found = @param name 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.end.not.permitted = invalid end tag: </{0}>
dc.tag.end.unexpected = unexpected end tag: </{0}>
......
/*
* @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() { }
}
LiteralTest.java:14: warning: {@code} within <code>
/** <code> abc {@code < & > } def </code> */
^
1 warning
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册