Skip to content

Commit

Permalink
ASTNode: improve IllegalArgumentException for more information
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Dec 3, 2024
1 parent eaff460 commit c002247
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3443,10 +3443,10 @@ public final int getLength() {
*/
public final void setSourceRange(int startPosition, int length) {
if (startPosition >= 0 && length < 0) {
throw new IllegalArgumentException();
throw new IllegalArgumentException("negative length=" + length + " startPosition= " + startPosition); //$NON-NLS-1$ //$NON-NLS-2$
}
if (startPosition < 0 && length != 0) {
throw new IllegalArgumentException();
throw new IllegalArgumentException("negative startPosition=" + startPosition + " length=" + length); //$NON-NLS-1$ //$NON-NLS-2$
}
// source positions are not considered a structural property
// but we protect them nevertheless
Expand Down

0 comments on commit c002247

Please sign in to comment.