|
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 */ |
|
23 |
|
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 LinkTest.java |
|
30 */ |
|
31 |
|
32 class LinkTest { |
|
33 /** |
|
34 * abc {@link String} def |
|
35 */ |
|
36 void simple_name() { } |
|
37 /* |
|
38 DocComment[DOC_COMMENT, pos:1 |
|
39 firstSentence: 3 |
|
40 Text[TEXT, pos:1, abc_] |
|
41 Link[LINK, pos:5 |
|
42 reference: |
|
43 Reference[REFERENCE, pos:12, String] |
|
44 body: empty |
|
45 ] |
|
46 Text[TEXT, pos:19, _def] |
|
47 body: empty |
|
48 block tags: empty |
|
49 ] |
|
50 */ |
|
51 |
|
52 /** |
|
53 * abc {@link String desc} def |
|
54 */ |
|
55 void simple_name_desc() { } |
|
56 /* |
|
57 DocComment[DOC_COMMENT, pos:1 |
|
58 firstSentence: 3 |
|
59 Text[TEXT, pos:1, abc_] |
|
60 Link[LINK, pos:5 |
|
61 reference: |
|
62 Reference[REFERENCE, pos:12, String] |
|
63 body: 1 |
|
64 Text[TEXT, pos:19, desc] |
|
65 ] |
|
66 Text[TEXT, pos:24, _def] |
|
67 body: empty |
|
68 block tags: empty |
|
69 ] |
|
70 */ |
|
71 |
|
72 /** |
|
73 * abc {@link java.lang.String desc} def |
|
74 */ |
|
75 void pkg_name_desc() { } |
|
76 /* |
|
77 DocComment[DOC_COMMENT, pos:1 |
|
78 firstSentence: 3 |
|
79 Text[TEXT, pos:1, abc_] |
|
80 Link[LINK, pos:5 |
|
81 reference: |
|
82 Reference[REFERENCE, pos:12, java.lang.String] |
|
83 body: 1 |
|
84 Text[TEXT, pos:29, desc] |
|
85 ] |
|
86 Text[TEXT, pos:34, _def] |
|
87 body: empty |
|
88 block tags: empty |
|
89 ] |
|
90 */ |
|
91 |
|
92 /** |
|
93 * abc {@link java.lang.String#isEmpty desc} def |
|
94 */ |
|
95 void method_desc() { } |
|
96 /* |
|
97 DocComment[DOC_COMMENT, pos:1 |
|
98 firstSentence: 3 |
|
99 Text[TEXT, pos:1, abc_] |
|
100 Link[LINK, pos:5 |
|
101 reference: |
|
102 Reference[REFERENCE, pos:12, java.lang.String#isEmpty] |
|
103 body: 1 |
|
104 Text[TEXT, pos:37, desc] |
|
105 ] |
|
106 Text[TEXT, pos:42, _def] |
|
107 body: empty |
|
108 block tags: empty |
|
109 ] |
|
110 */ |
|
111 |
|
112 /** |
|
113 * abc {@link java.lang.String#isEmpty() desc} def |
|
114 */ |
|
115 void method_0_args_desc() { } |
|
116 /* |
|
117 DocComment[DOC_COMMENT, pos:1 |
|
118 firstSentence: 3 |
|
119 Text[TEXT, pos:1, abc_] |
|
120 Link[LINK, pos:5 |
|
121 reference: |
|
122 Reference[REFERENCE, pos:12, java.lang.String#isEmpty()] |
|
123 body: 1 |
|
124 Text[TEXT, pos:39, desc] |
|
125 ] |
|
126 Text[TEXT, pos:44, _def] |
|
127 body: empty |
|
128 block tags: empty |
|
129 ] |
|
130 */ |
|
131 |
|
132 /** |
|
133 * abc {@link java.lang.String#substring(int) desc} def |
|
134 */ |
|
135 void method_1_args_desc() { } |
|
136 /* |
|
137 DocComment[DOC_COMMENT, pos:1 |
|
138 firstSentence: 3 |
|
139 Text[TEXT, pos:1, abc_] |
|
140 Link[LINK, pos:5 |
|
141 reference: |
|
142 Reference[REFERENCE, pos:12, java.lang.String#substring(int)] |
|
143 body: 1 |
|
144 Text[TEXT, pos:44, desc] |
|
145 ] |
|
146 Text[TEXT, pos:49, _def] |
|
147 body: empty |
|
148 block tags: empty |
|
149 ] |
|
150 */ |
|
151 |
|
152 /** |
|
153 * abc {@link java.lang.String#substring(int, int) desc} def |
|
154 */ |
|
155 void method_2_args_desc() { } |
|
156 /* |
|
157 DocComment[DOC_COMMENT, pos:1 |
|
158 firstSentence: 3 |
|
159 Text[TEXT, pos:1, abc_] |
|
160 Link[LINK, pos:5 |
|
161 reference: |
|
162 Reference[REFERENCE, pos:12, java.lang.String...#substring(int,_int)] |
|
163 body: 1 |
|
164 Text[TEXT, pos:49, desc] |
|
165 ] |
|
166 Text[TEXT, pos:54, _def] |
|
167 body: empty |
|
168 block tags: empty |
|
169 ] |
|
170 */ |
|
171 |
|
172 /** |
|
173 * abc {@link java.util.List<T> desc} def |
|
174 */ |
|
175 void pkg_name_typarams_desc() { } |
|
176 /* |
|
177 DocComment[DOC_COMMENT, pos:1 |
|
178 firstSentence: 3 |
|
179 Text[TEXT, pos:1, abc_] |
|
180 Link[LINK, pos:5 |
|
181 reference: |
|
182 Reference[REFERENCE, pos:12, java.util.List<T>] |
|
183 body: 1 |
|
184 Text[TEXT, pos:30, desc] |
|
185 ] |
|
186 Text[TEXT, pos:35, _def] |
|
187 body: empty |
|
188 block tags: empty |
|
189 ] |
|
190 */ |
|
191 |
|
192 } |