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 Nov 26, 2024
1 parent 54be506 commit e653f3e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e653f3e

Please sign in to comment.