Skip to content

Commit

Permalink
Use simple name length instead of javac node length.
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanper committed Jul 16, 2024
1 parent 6df7311 commit 0ce7ac2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private void nameSettings(SimpleName name, JCMethodDecl javac) {
if (javac.getReturnType() != null) {
start = javac.getReturnType().getEndPosition(this.javacCompilationUnit.endPositions);
}
var length = javac.getName().length();
var length = name.getLength(); // use SimpleName since it can change due to erroneous scenarios
name.setSourceRange(start, length);
}

Expand All @@ -402,7 +402,7 @@ private void nameSettings(SimpleName name, JCVariableDecl javac) {
if (javac.getType() != null) {
start = javac.getType().getEndPosition(this.javacCompilationUnit.endPositions);
}
var length = javac.getName().length();
var length = name.getLength(); // use SimpleName since it can change due to erroneous scenarios
name.setSourceRange(start, length);
}

Expand Down

0 comments on commit 0ce7ac2

Please sign in to comment.