diff --git a/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java b/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java index 535dbd2692e789c583b972e866b42b68973676c9..b96c7c32669df8e849766584fd686201ba1e2715 100644 --- a/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java +++ b/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java @@ -280,7 +280,7 @@ public class DocCommentParser { try { nextChar(); if (isIdentifierStart(ch)) { - Name name = readIdentifier(); + Name name = readTagName(); TagParser tp = tagParsers.get(name); if (tp == null) { List content = blockContent(); @@ -329,7 +329,7 @@ public class DocCommentParser { try { nextChar(); if (isIdentifierStart(ch)) { - Name name = readIdentifier(); + Name name = readTagName(); skipWhitespace(); TagParser tp = tagParsers.get(name); @@ -905,6 +905,14 @@ public class DocCommentParser { return names.fromChars(buf, start, bp - start); } + protected Name readTagName() { + int start = bp; + nextChar(); + while (bp < buflen && (Character.isUnicodeIdentifierPart(ch) || ch == '.')) + nextChar(); + return names.fromChars(buf, start, bp - start); + } + protected boolean isJavaIdentifierStart(char ch) { return Character.isJavaIdentifierStart(ch); } diff --git a/test/tools/doclint/CustomTagTest.java b/test/tools/doclint/CustomTagTest.java index 3340dfb878c097f046fef97211fe910e5f2bc235..64ae347e4368c69630bd82478933f55f129c2397 100644 --- a/test/tools/doclint/CustomTagTest.java +++ b/test/tools/doclint/CustomTagTest.java @@ -1,17 +1,18 @@ /* * @test /nodynamiccopyright/ - * @bug 8006248 + * @bug 8006248 8028318 * @summary DocLint should report unknown tags * @build DocLintTester * @run main DocLintTester CustomTagTest.java * @run main DocLintTester -XcustomTags: -ref CustomTagTest.out CustomTagTest.java - * @run main DocLintTester -XcustomTags:customTag -ref CustomTagTestWithOption.out CustomTagTest.java - * @run main DocLintTester -XcustomTags:customTag,anotherCustomTag -ref CustomTagTestWithOption.out CustomTagTest.java + * @run main DocLintTester -XcustomTags:customTag,custom.tag -ref CustomTagTestWithOption.out CustomTagTest.java + * @run main DocLintTester -XcustomTags:customTag,custom.tag,anotherCustomTag -ref CustomTagTestWithOption.out CustomTagTest.java * @author bpatel */ /** * @customTag Text for a custom tag. + * @custom.tag Text for another custom tag. * @unknownTag Text for an unknown tag. */ public class CustomTagTest { diff --git a/test/tools/doclint/CustomTagTest.out b/test/tools/doclint/CustomTagTest.out index 063e313071ece81c3b514067c58d8acabc46487d..4c58a3d3604fe7094d7761968cede88d2005562e 100644 --- a/test/tools/doclint/CustomTagTest.out +++ b/test/tools/doclint/CustomTagTest.out @@ -1,8 +1,11 @@ CustomTagTest.java:14: error: unknown tag: customTag * @customTag Text for a custom tag. ^ -CustomTagTest.java:15: error: unknown tag: unknownTag +CustomTagTest.java:15: error: unknown tag: custom.tag + * @custom.tag Text for another custom tag. + ^ +CustomTagTest.java:16: error: unknown tag: unknownTag * @unknownTag Text for an unknown tag. ^ -2 errors +3 errors diff --git a/test/tools/doclint/CustomTagTestWithOption.out b/test/tools/doclint/CustomTagTestWithOption.out index 09150146e0cd17870df394beb9dd55a8ac8febb4..f5b67cf1d93ec35a7781a85c707e65e8af313224 100644 --- a/test/tools/doclint/CustomTagTestWithOption.out +++ b/test/tools/doclint/CustomTagTestWithOption.out @@ -1,4 +1,4 @@ -CustomTagTest.java:15: error: unknown tag: unknownTag +CustomTagTest.java:16: error: unknown tag: unknownTag * @unknownTag Text for an unknown tag. ^ 1 error