Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. |
aoqi@0 | 8 | * |
aoqi@0 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 13 | * accompanied this code). |
aoqi@0 | 14 | * |
aoqi@0 | 15 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 18 | * |
aoqi@0 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 20 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 21 | * questions. |
aoqi@0 | 22 | */ |
aoqi@0 | 23 | |
aoqi@0 | 24 | /* |
aoqi@0 | 25 | * @test |
aoqi@0 | 26 | * @bug 7021614 |
aoqi@0 | 27 | * @summary extend com.sun.source API to support parsing javadoc comments |
aoqi@0 | 28 | * @build DocCommentTester |
aoqi@0 | 29 | * @run main DocCommentTester LinkTest.java |
aoqi@0 | 30 | */ |
aoqi@0 | 31 | |
aoqi@0 | 32 | class LinkTest { |
aoqi@0 | 33 | /** |
aoqi@0 | 34 | * abc {@link String} def |
aoqi@0 | 35 | */ |
aoqi@0 | 36 | void simple_name() { } |
aoqi@0 | 37 | /* |
aoqi@0 | 38 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 39 | firstSentence: 3 |
aoqi@0 | 40 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 41 | Link[LINK, pos:5 |
aoqi@0 | 42 | reference: |
aoqi@0 | 43 | Reference[REFERENCE, pos:12, String] |
aoqi@0 | 44 | body: empty |
aoqi@0 | 45 | ] |
aoqi@0 | 46 | Text[TEXT, pos:19, _def] |
aoqi@0 | 47 | body: empty |
aoqi@0 | 48 | block tags: empty |
aoqi@0 | 49 | ] |
aoqi@0 | 50 | */ |
aoqi@0 | 51 | |
aoqi@0 | 52 | /** |
aoqi@0 | 53 | * abc {@link String desc} def |
aoqi@0 | 54 | */ |
aoqi@0 | 55 | void simple_name_desc() { } |
aoqi@0 | 56 | /* |
aoqi@0 | 57 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 58 | firstSentence: 3 |
aoqi@0 | 59 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 60 | Link[LINK, pos:5 |
aoqi@0 | 61 | reference: |
aoqi@0 | 62 | Reference[REFERENCE, pos:12, String] |
aoqi@0 | 63 | body: 1 |
aoqi@0 | 64 | Text[TEXT, pos:19, desc] |
aoqi@0 | 65 | ] |
aoqi@0 | 66 | Text[TEXT, pos:24, _def] |
aoqi@0 | 67 | body: empty |
aoqi@0 | 68 | block tags: empty |
aoqi@0 | 69 | ] |
aoqi@0 | 70 | */ |
aoqi@0 | 71 | |
aoqi@0 | 72 | /** |
aoqi@0 | 73 | * abc {@link java.lang.String desc} def |
aoqi@0 | 74 | */ |
aoqi@0 | 75 | void pkg_name_desc() { } |
aoqi@0 | 76 | /* |
aoqi@0 | 77 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 78 | firstSentence: 3 |
aoqi@0 | 79 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 80 | Link[LINK, pos:5 |
aoqi@0 | 81 | reference: |
aoqi@0 | 82 | Reference[REFERENCE, pos:12, java.lang.String] |
aoqi@0 | 83 | body: 1 |
aoqi@0 | 84 | Text[TEXT, pos:29, desc] |
aoqi@0 | 85 | ] |
aoqi@0 | 86 | Text[TEXT, pos:34, _def] |
aoqi@0 | 87 | body: empty |
aoqi@0 | 88 | block tags: empty |
aoqi@0 | 89 | ] |
aoqi@0 | 90 | */ |
aoqi@0 | 91 | |
aoqi@0 | 92 | /** |
aoqi@0 | 93 | * abc {@link java.lang.String#isEmpty desc} def |
aoqi@0 | 94 | */ |
aoqi@0 | 95 | void method_desc() { } |
aoqi@0 | 96 | /* |
aoqi@0 | 97 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 98 | firstSentence: 3 |
aoqi@0 | 99 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 100 | Link[LINK, pos:5 |
aoqi@0 | 101 | reference: |
aoqi@0 | 102 | Reference[REFERENCE, pos:12, java.lang.String#isEmpty] |
aoqi@0 | 103 | body: 1 |
aoqi@0 | 104 | Text[TEXT, pos:37, desc] |
aoqi@0 | 105 | ] |
aoqi@0 | 106 | Text[TEXT, pos:42, _def] |
aoqi@0 | 107 | body: empty |
aoqi@0 | 108 | block tags: empty |
aoqi@0 | 109 | ] |
aoqi@0 | 110 | */ |
aoqi@0 | 111 | |
aoqi@0 | 112 | /** |
aoqi@0 | 113 | * abc {@link java.lang.String#isEmpty() desc} def |
aoqi@0 | 114 | */ |
aoqi@0 | 115 | void method_0_args_desc() { } |
aoqi@0 | 116 | /* |
aoqi@0 | 117 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 118 | firstSentence: 3 |
aoqi@0 | 119 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 120 | Link[LINK, pos:5 |
aoqi@0 | 121 | reference: |
aoqi@0 | 122 | Reference[REFERENCE, pos:12, java.lang.String#isEmpty()] |
aoqi@0 | 123 | body: 1 |
aoqi@0 | 124 | Text[TEXT, pos:39, desc] |
aoqi@0 | 125 | ] |
aoqi@0 | 126 | Text[TEXT, pos:44, _def] |
aoqi@0 | 127 | body: empty |
aoqi@0 | 128 | block tags: empty |
aoqi@0 | 129 | ] |
aoqi@0 | 130 | */ |
aoqi@0 | 131 | |
aoqi@0 | 132 | /** |
aoqi@0 | 133 | * abc {@link java.lang.String#substring(int) desc} def |
aoqi@0 | 134 | */ |
aoqi@0 | 135 | void method_1_args_desc() { } |
aoqi@0 | 136 | /* |
aoqi@0 | 137 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 138 | firstSentence: 3 |
aoqi@0 | 139 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 140 | Link[LINK, pos:5 |
aoqi@0 | 141 | reference: |
aoqi@0 | 142 | Reference[REFERENCE, pos:12, java.lang.String#substring(int)] |
aoqi@0 | 143 | body: 1 |
aoqi@0 | 144 | Text[TEXT, pos:44, desc] |
aoqi@0 | 145 | ] |
aoqi@0 | 146 | Text[TEXT, pos:49, _def] |
aoqi@0 | 147 | body: empty |
aoqi@0 | 148 | block tags: empty |
aoqi@0 | 149 | ] |
aoqi@0 | 150 | */ |
aoqi@0 | 151 | |
aoqi@0 | 152 | /** |
aoqi@0 | 153 | * abc {@link java.lang.String#substring(int, int) desc} def |
aoqi@0 | 154 | */ |
aoqi@0 | 155 | void method_2_args_desc() { } |
aoqi@0 | 156 | /* |
aoqi@0 | 157 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 158 | firstSentence: 3 |
aoqi@0 | 159 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 160 | Link[LINK, pos:5 |
aoqi@0 | 161 | reference: |
aoqi@0 | 162 | Reference[REFERENCE, pos:12, java.lang.String...#substring(int,_int)] |
aoqi@0 | 163 | body: 1 |
aoqi@0 | 164 | Text[TEXT, pos:49, desc] |
aoqi@0 | 165 | ] |
aoqi@0 | 166 | Text[TEXT, pos:54, _def] |
aoqi@0 | 167 | body: empty |
aoqi@0 | 168 | block tags: empty |
aoqi@0 | 169 | ] |
aoqi@0 | 170 | */ |
aoqi@0 | 171 | |
aoqi@0 | 172 | /** |
aoqi@0 | 173 | * abc {@link java.util.List<T> desc} def |
aoqi@0 | 174 | */ |
aoqi@0 | 175 | void pkg_name_typarams_desc() { } |
aoqi@0 | 176 | /* |
aoqi@0 | 177 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 178 | firstSentence: 3 |
aoqi@0 | 179 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 180 | Link[LINK, pos:5 |
aoqi@0 | 181 | reference: |
aoqi@0 | 182 | Reference[REFERENCE, pos:12, java.util.List<T>] |
aoqi@0 | 183 | body: 1 |
aoqi@0 | 184 | Text[TEXT, pos:30, desc] |
aoqi@0 | 185 | ] |
aoqi@0 | 186 | Text[TEXT, pos:35, _def] |
aoqi@0 | 187 | body: empty |
aoqi@0 | 188 | block tags: empty |
aoqi@0 | 189 | ] |
aoqi@0 | 190 | */ |
aoqi@0 | 191 | |
aoqi@0 | 192 | } |