Skip to content

Commit

Permalink
Off by one error in source range of VariableDeclarationFragment
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
Rob Stryker committed Apr 5, 2024
1 parent b1d1129 commit b1a37dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private VariableDeclarationFragment createVariableDeclarationFragment(JCVariable
int fragmentStart = javac.pos;
int fragmentLength = fragmentEnd - fragmentStart; // ???? - 1;
char c = this.rawText.charAt(fragmentEnd-1);
if( c == ';') {
if( c == ';' || c == ',') {
fragmentLength--;
}
fragment.setSourceRange(fragmentStart, Math.max(0, fragmentLength));
Expand Down

0 comments on commit b1a37dd

Please sign in to comment.