Skip to content

Commit

Permalink
JDT expects semicolon to be part of source range for superconstructor…
Browse files Browse the repository at this point in the history
… call

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Apr 8, 2024
1 parent cf02013 commit 4ddf41e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,11 @@ private SuperMethodInvocation convertSuperMethodInvocation(JCMethodInvocation ja
private SuperConstructorInvocation convertSuperConstructorInvocation(JCMethodInvocation javac) {
SuperConstructorInvocation res = this.ast.newSuperConstructorInvocation();
commonSettings(res, javac);
int end = res.getStartPosition() + res.getLength();
if( end < this.rawText.length() && this.rawText.charAt(end-1) != ';' && this.rawText.charAt(end) == ';') {
// jdt expects semicolon to be part of the range
res.setSourceRange(res.getStartPosition(), res.getLength() + 1);
}
javac.getArguments().stream().map(this::convertExpression).forEach(res.arguments()::add);

//res.setFlags(javac.getFlags() | ASTNode.MALFORMED);
Expand Down

0 comments on commit 4ddf41e

Please sign in to comment.