Skip to content

Commit 022290b

Browse files
committedApr 5, 2023
8305620: Missing break in DocCommentParser inlineWord()
Reviewed-by: iris
1 parent 2e59d21 commit 022290b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
 

‎src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,16 @@ protected DCText inlineWord() {
586586
case '@':
587587
if (newline)
588588
break loop;
589+
break;
589590

590591
case '{':
591592
depth++;
592593
break;
593594

594595
case '}':
595-
if (depth == 0 || --depth == 0)
596+
if (depth == 0)
596597
return m.at(pos).newTextTree(newString(pos, bp));
598+
depth--;
597599
break;
598600
}
599601
newline = false;

‎test/langtools/tools/javac/doctree/IndexTest.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8144287 8273244 8284908
26+
* @bug 8144287 8273244 8284908 8305620
2727
* @summary extend com.sun.source API to support parsing javadoc comments
2828
* @modules jdk.compiler/com.sun.tools.javac.api
2929
* jdk.compiler/com.sun.tools.javac.file
@@ -155,12 +155,12 @@ void phrase_with_description() { }
155155
*/
156156

157157
/**
158-
* abc {@index {@xyz} "{@see xyz}" def}
158+
* abc {@index {@xyz} "{@see xyz}"} def
159159
*/
160160
void term_and_description_with_nested_tag() {}
161161
/*
162162
DocComment[DOC_COMMENT, pos:1
163-
firstSentence: 2
163+
firstSentence: 3
164164
Text[TEXT, pos:1, abc_]
165165
Index[INDEX, pos:5
166166
term:
@@ -172,8 +172,9 @@ void term_and_description_with_nested_tag() {}
172172
content: 1
173173
Text[TEXT, pos:27, xyz]
174174
]
175-
Text[TEXT, pos:31, "_def]
175+
Text[TEXT, pos:31, "]
176176
]
177+
Text[TEXT, pos:33, _def]
177178
body: empty
178179
block tags: empty
179180
]

0 commit comments

Comments
 (0)
Please sign in to comment.