Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
1 /*
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 /*
25 * @test
26 * @bug 7021614
27 * @summary extend com.sun.source API to support parsing javadoc comments
28 * @build DocCommentTester
29 * @run main DocCommentTester TagTest.java
30 */
32 class TagTest {
33 /**
34 * @author jjg
35 */
36 void simple_standard_block() { }
37 /*
38 DocComment[DOC_COMMENT, pos:1
39 firstSentence: empty
40 body: empty
41 block tags: 1
42 Author[AUTHOR, pos:1
43 name: 1
44 Text[TEXT, pos:9, jjg]
45 ]
46 ]
47 */
49 /**
50 * @ abc
51 */
52 void no_name_block() { }
53 /*
54 DocComment[DOC_COMMENT, pos:1
55 firstSentence: empty
56 body: empty
57 block tags: 1
58 Erroneous[ERRONEOUS, pos:1
59 code: compiler.err.dc.no.tag.name
60 body: @_abc
61 ]
62 ]
63 */
65 /**
66 * @abc def ghi
67 */
68 void unknown_name_block() { }
69 /*
70 DocComment[DOC_COMMENT, pos:1
71 firstSentence: empty
72 body: empty
73 block tags: 1
74 UnknownBlockTag[UNKNOWN_BLOCK_TAG, pos:1
75 tag:abc
76 content: 1
77 Text[TEXT, pos:6, def_ghi]
78 ]
79 ]
80 */
82 /**
83 * {@link String}
84 */
85 void simple_standard_inline() { }
86 /*
87 DocComment[DOC_COMMENT, pos:1
88 firstSentence: 1
89 Link[LINK, pos:1
90 reference:
91 Reference[REFERENCE, pos:8, String]
92 body: empty
93 ]
94 body: empty
95 block tags: empty
96 ]
97 */
99 /**
100 * {@ abc}
101 */
102 void no_name_inline() { }
103 /*
104 DocComment[DOC_COMMENT, pos:1
105 firstSentence: 2
106 Erroneous[ERRONEOUS, pos:1
107 code: compiler.err.dc.no.tag.name
108 body: {@
109 ]
110 Text[TEXT, pos:3, _abc}]
111 body: empty
112 block tags: empty
113 ]
114 */
116 /**
117 * {@abc def ghi}
118 */
119 void unknown_name_inline() { }
120 /*
121 DocComment[DOC_COMMENT, pos:1
122 firstSentence: 1
123 UnknownInlineTag[UNKNOWN_INLINE_TAG, pos:1
124 tag:abc
125 content: 1
126 Text[TEXT, pos:7, def_ghi]
127 ]
128 body: empty
129 block tags: empty
130 ]
131 */
133 /**
134 * {@abc def ghi
135 */
136 void unterminated_standard_inline() { }
137 /*
138 DocComment[DOC_COMMENT, pos:1
139 firstSentence: 1
140 Erroneous[ERRONEOUS, pos:1
141 code: compiler.err.dc.unterminated.inline.tag
142 body: {@abc_def_ghi
143 ]
144 body: empty
145 block tags: empty
146 ]
147 */
149 }