Skip to content

Commit

Permalink
Javadoc error on jls2 - comment empty
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
Rob Stryker committed May 9, 2024
1 parent cbfc40e commit 5f13dcf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ private void commonSettings(ASTNode res, DCTree javac) {

Javadoc convertJavadoc() {
Javadoc res = this.ast.newJavadoc();
res.setSourceRange(this.initialOffset, this.endOffset);
res.setSourceRange(this.initialOffset, this.endOffset - this.initialOffset);
if( this.javacConverter.ast.apiLevel == AST.JLS2_INTERNAL) {
String rawContent = this.javacConverter.rawText.substring(this.initialOffset, this.endOffset);
res.setComment(rawContent);
}
IDocElement[] elements = Stream.of(docComment.preamble, docComment.fullBody, docComment.postamble, docComment.tags)
.flatMap(List::stream)
.map(this::convertElement)
Expand Down

0 comments on commit 5f13dcf

Please sign in to comment.