Fri, 24 Apr 2020 03:58:51 +0100
Merge
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 FirstSentenceTest.java |
aoqi@0 | 30 | */ |
aoqi@0 | 31 | |
aoqi@0 | 32 | class FirstSentenceTest { |
aoqi@0 | 33 | /** */ |
aoqi@0 | 34 | void empty() { } |
aoqi@0 | 35 | /* |
aoqi@0 | 36 | DocComment[DOC_COMMENT, pos:-1 |
aoqi@0 | 37 | firstSentence: empty |
aoqi@0 | 38 | body: empty |
aoqi@0 | 39 | block tags: empty |
aoqi@0 | 40 | ] |
aoqi@0 | 41 | */ |
aoqi@0 | 42 | |
aoqi@0 | 43 | /** abc def ghi */ |
aoqi@0 | 44 | void no_terminator() { } |
aoqi@0 | 45 | /* |
aoqi@0 | 46 | DocComment[DOC_COMMENT, pos:0 |
aoqi@0 | 47 | firstSentence: 1 |
aoqi@0 | 48 | Text[TEXT, pos:0, abc_def_ghi] |
aoqi@0 | 49 | body: empty |
aoqi@0 | 50 | block tags: empty |
aoqi@0 | 51 | ] |
aoqi@0 | 52 | */ |
aoqi@0 | 53 | |
aoqi@0 | 54 | /** |
aoqi@0 | 55 | * abc def ghi. |
aoqi@0 | 56 | */ |
aoqi@0 | 57 | void no_body() { } |
aoqi@0 | 58 | /* |
aoqi@0 | 59 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 60 | firstSentence: 1 |
aoqi@0 | 61 | Text[TEXT, pos:1, abc_def_ghi.] |
aoqi@0 | 62 | body: empty |
aoqi@0 | 63 | block tags: empty |
aoqi@0 | 64 | ] |
aoqi@0 | 65 | */ |
aoqi@0 | 66 | |
aoqi@0 | 67 | /** |
aoqi@0 | 68 | * abc def ghi. jkl mno pqr. |
aoqi@0 | 69 | */ |
aoqi@0 | 70 | void dot_space() { } |
aoqi@0 | 71 | /* |
aoqi@0 | 72 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 73 | firstSentence: 1 |
aoqi@0 | 74 | Text[TEXT, pos:1, abc_def_ghi.] |
aoqi@0 | 75 | body: 1 |
aoqi@0 | 76 | Text[TEXT, pos:14, jkl_mno_pqr.] |
aoqi@0 | 77 | block tags: empty |
aoqi@0 | 78 | ] |
aoqi@0 | 79 | */ |
aoqi@0 | 80 | |
aoqi@0 | 81 | /** |
aoqi@0 | 82 | * abc def ghi. |
aoqi@0 | 83 | * jkl mno pqr |
aoqi@0 | 84 | */ |
aoqi@0 | 85 | void dot_newline() { } |
aoqi@0 | 86 | /* |
aoqi@0 | 87 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 88 | firstSentence: 1 |
aoqi@0 | 89 | Text[TEXT, pos:1, abc_def_ghi.] |
aoqi@0 | 90 | body: 1 |
aoqi@0 | 91 | Text[TEXT, pos:15, jkl_mno_pqr] |
aoqi@0 | 92 | block tags: empty |
aoqi@0 | 93 | ] |
aoqi@0 | 94 | */ |
aoqi@0 | 95 | |
aoqi@0 | 96 | /** |
aoqi@0 | 97 | * abc def ghi |
aoqi@0 | 98 | * <p>jkl mno pqr |
aoqi@0 | 99 | */ |
aoqi@0 | 100 | void dot_p() { } |
aoqi@0 | 101 | /* |
aoqi@0 | 102 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 103 | firstSentence: 1 |
aoqi@0 | 104 | Text[TEXT, pos:1, abc_def_ghi] |
aoqi@0 | 105 | body: 2 |
aoqi@0 | 106 | StartElement[START_ELEMENT, pos:14 |
aoqi@0 | 107 | name:p |
aoqi@0 | 108 | attributes: empty |
aoqi@0 | 109 | ] |
aoqi@0 | 110 | Text[TEXT, pos:17, jkl_mno_pqr] |
aoqi@0 | 111 | block tags: empty |
aoqi@0 | 112 | ] |
aoqi@0 | 113 | */ |
aoqi@0 | 114 | |
aoqi@0 | 115 | /** |
aoqi@0 | 116 | * abc def ghi |
aoqi@0 | 117 | * </p>jkl mno pqr |
aoqi@0 | 118 | */ |
aoqi@0 | 119 | void dot_end_p() { } |
aoqi@0 | 120 | /* |
aoqi@0 | 121 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 122 | firstSentence: 1 |
aoqi@0 | 123 | Text[TEXT, pos:1, abc_def_ghi] |
aoqi@0 | 124 | body: 2 |
aoqi@0 | 125 | EndElement[END_ELEMENT, pos:14, p] |
aoqi@0 | 126 | Text[TEXT, pos:18, jkl_mno_pqr] |
aoqi@0 | 127 | block tags: empty |
aoqi@0 | 128 | ] |
aoqi@0 | 129 | */ |
aoqi@0 | 130 | |
aoqi@0 | 131 | /** |
aoqi@0 | 132 | * abc < ghi. jkl mno pqr. |
aoqi@0 | 133 | */ |
aoqi@0 | 134 | void entity() { } |
aoqi@0 | 135 | /* |
aoqi@0 | 136 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 137 | firstSentence: 3 |
aoqi@0 | 138 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 139 | Entity[ENTITY, pos:5, lt] |
aoqi@0 | 140 | Text[TEXT, pos:9, _ghi.] |
aoqi@0 | 141 | body: 1 |
aoqi@0 | 142 | Text[TEXT, pos:15, jkl_mno_pqr.] |
aoqi@0 | 143 | block tags: empty |
aoqi@0 | 144 | ] |
aoqi@0 | 145 | */ |
aoqi@0 | 146 | |
aoqi@0 | 147 | /** |
aoqi@0 | 148 | * abc {@code code} ghi. jkl mno pqr. |
aoqi@0 | 149 | */ |
aoqi@0 | 150 | void inline_tag() { } |
aoqi@0 | 151 | /* |
aoqi@0 | 152 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 153 | firstSentence: 3 |
aoqi@0 | 154 | Text[TEXT, pos:1, abc_] |
aoqi@0 | 155 | Literal[CODE, pos:5, code] |
aoqi@0 | 156 | Text[TEXT, pos:17, _ghi.] |
aoqi@0 | 157 | body: 1 |
aoqi@0 | 158 | Text[TEXT, pos:23, jkl_mno_pqr.] |
aoqi@0 | 159 | block tags: empty |
aoqi@0 | 160 | ] |
aoqi@0 | 161 | */ |
aoqi@0 | 162 | |
aoqi@0 | 163 | /** |
aoqi@0 | 164 | * abc def ghi |
aoqi@0 | 165 | * @author jjg |
aoqi@0 | 166 | */ |
aoqi@0 | 167 | void block_tag() { } |
aoqi@0 | 168 | /* |
aoqi@0 | 169 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 170 | firstSentence: 1 |
aoqi@0 | 171 | Text[TEXT, pos:1, abc_def_ghi] |
aoqi@0 | 172 | body: empty |
aoqi@0 | 173 | block tags: 1 |
aoqi@0 | 174 | Author[AUTHOR, pos:14 |
aoqi@0 | 175 | name: 1 |
aoqi@0 | 176 | Text[TEXT, pos:22, jjg] |
aoqi@0 | 177 | ] |
aoqi@0 | 178 | ] |
aoqi@0 | 179 | */ |
aoqi@0 | 180 | |
aoqi@0 | 181 | /** |
aoqi@0 | 182 | * @author jjg |
aoqi@0 | 183 | */ |
aoqi@0 | 184 | void just_tag() { } |
aoqi@0 | 185 | /* |
aoqi@0 | 186 | DocComment[DOC_COMMENT, pos:1 |
aoqi@0 | 187 | firstSentence: empty |
aoqi@0 | 188 | body: empty |
aoqi@0 | 189 | block tags: 1 |
aoqi@0 | 190 | Author[AUTHOR, pos:1 |
aoqi@0 | 191 | name: 1 |
aoqi@0 | 192 | Text[TEXT, pos:9, jjg] |
aoqi@0 | 193 | ] |
aoqi@0 | 194 | ] |
aoqi@0 | 195 | */ |
aoqi@0 | 196 | |
aoqi@0 | 197 | } |
aoqi@0 | 198 |