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