8264843: Javac crashes with NullPointerException when finding unencoded XML in <pre> tag
Reviewed-by: hannesw
This commit is contained in:
parent
2047da7dcc
commit
0011b52ee8
@ -383,11 +383,11 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for self closing tags, such as <a id="name"/>
|
||||
if (tree.isSelfClosing() && !isSelfClosingAllowed(t)) {
|
||||
env.messages.error(HTML, tree, "dc.tag.self.closing", treeName);
|
||||
// check for self closing tags, such as <a id="name"/>
|
||||
if (tree.isSelfClosing() && !isSelfClosingAllowed(t)) {
|
||||
env.messages.error(HTML, tree, "dc.tag.self.closing", treeName);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
17
test/langtools/tools/doclint/html/UnknownTagTest.java
Normal file
17
test/langtools/tools/doclint/html/UnknownTagTest.java
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8264843
|
||||
* @summary Javac crashes with NullPointerException when finding unencoded XML in <pre> tag
|
||||
* @library ..
|
||||
* @modules jdk.javadoc/jdk.javadoc.internal.doclint
|
||||
* @build DocLintTester
|
||||
* @run main DocLintTester -Xmsgs -ref UnknownTagTest.out UnknownTagTest.java
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is an <unknown> tag.
|
||||
* This is an <unknown a=b> tag with attributes.
|
||||
* This is an <unknown/> self-closing tag.
|
||||
*/
|
||||
public class UnknownTagTest {
|
||||
}
|
10
test/langtools/tools/doclint/html/UnknownTagTest.out
Normal file
10
test/langtools/tools/doclint/html/UnknownTagTest.out
Normal file
@ -0,0 +1,10 @@
|
||||
UnknownTagTest.java:12: error: unknown tag: unknown
|
||||
* This is an <unknown> tag.
|
||||
^
|
||||
UnknownTagTest.java:13: error: unknown tag: unknown
|
||||
* This is an <unknown a=b> tag with attributes.
|
||||
^
|
||||
UnknownTagTest.java:14: error: unknown tag: unknown
|
||||
* This is an <unknown/> self-closing tag.
|
||||
^
|
||||
3 errors
|
Loading…
Reference in New Issue
Block a user