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 8031212
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 SeeTest.java
34 */
35
36class SeeTest {
37    /**
38     * abc.
39     * @see "String"
40     */
41    void quoted_text() { }
42/*
43DocComment[DOC_COMMENT, pos:1
44  firstSentence: 1
45    Text[TEXT, pos:1, abc.]
46  body: empty
47  block tags: 1
48    See[SEE, pos:7
49      reference: 1
50        Text[TEXT, pos:12, "String"]
51    ]
52]
53*/
54
55    /**
56     * abc.
57     * @see <a href="url">url</a>
58     */
59    void url() { }
60/*
61DocComment[DOC_COMMENT, pos:1
62  firstSentence: 1
63    Text[TEXT, pos:1, abc.]
64  body: empty
65  block tags: 1
66    See[SEE, pos:7
67      reference: 3
68        StartElement[START_ELEMENT, pos:12
69          name:a
70          attributes: 1
71            Attribute[ATTRIBUTE, pos:15
72              name: href
73              vkind: DOUBLE
74              value: 1
75                Text[TEXT, pos:21, url]
76            ]
77        ]
78        Text[TEXT, pos:26, url]
79        EndElement[END_ELEMENT, pos:29, a]
80    ]
81]
82*/
83
84    /**
85     * abc.
86     * @see String text
87     */
88    void string() { }
89/*
90DocComment[DOC_COMMENT, pos:1
91  firstSentence: 1
92    Text[TEXT, pos:1, abc.]
93  body: empty
94  block tags: 1
95    See[SEE, pos:7
96      reference: 2
97        Reference[REFERENCE, pos:12, String]
98        Text[TEXT, pos:19, text]
99    ]
100]
101*/
102
103    /**
104     * abc.
105     * @see java.lang.String text
106     */
107    void j_l_string() { }
108/*
109DocComment[DOC_COMMENT, pos:1
110  firstSentence: 1
111    Text[TEXT, pos:1, abc.]
112  body: empty
113  block tags: 1
114    See[SEE, pos:7
115      reference: 2
116        Reference[REFERENCE, pos:12, java.lang.String]
117        Text[TEXT, pos:29, text]
118    ]
119]
120*/
121
122    /**
123     * abc.
124     * @see java.lang.String#length text
125     */
126    void j_l_string_length() { }
127/*
128DocComment[DOC_COMMENT, pos:1
129  firstSentence: 1
130    Text[TEXT, pos:1, abc.]
131  body: empty
132  block tags: 1
133    See[SEE, pos:7
134      reference: 2
135        Reference[REFERENCE, pos:12, java.lang.String#length]
136        Text[TEXT, pos:36, text]
137    ]
138]
139*/
140
141    /**
142     * abc.
143     * @see java.lang.String#matches(String regex) text
144     */
145    void j_l_string_matches() { }
146/*
147DocComment[DOC_COMMENT, pos:1
148  firstSentence: 1
149    Text[TEXT, pos:1, abc.]
150  body: empty
151  block tags: 1
152    See[SEE, pos:7
153      reference: 2
154        Reference[REFERENCE, pos:12, java.lang.String...#matches(String_regex)]
155        Text[TEXT, pos:51, text]
156    ]
157]
158*/
159
160    /**
161     * abc.
162     * @see 123 text
163     */
164    void bad_numeric() { }
165/*
166DocComment[DOC_COMMENT, pos:1
167  firstSentence: 1
168    Text[TEXT, pos:1, abc.]
169  body: empty
170  block tags: 1
171    Erroneous[ERRONEOUS, pos:7
172      code: compiler.err.dc.unexpected.content
173      body: @see_123_text
174    ]
175]
176*/
177
178}
179