Skip to content

Commit 1d61578

Browse files
committed
ASTNode: improve IllegalArgumentException for more information
#3309
1 parent 74ec8f9 commit 1d61578

File tree

1 file changed

+2
-2
lines changed
  • org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom

1 file changed

+2
-2
lines changed

org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,10 +3443,10 @@ public final int getLength() {
34433443
*/
34443444
public final void setSourceRange(int startPosition, int length) {
34453445
if (startPosition >= 0 && length < 0) {
3446-
throw new IllegalArgumentException();
3446+
throw new IllegalArgumentException("negative length=" + length + " startPosition= " + startPosition); //$NON-NLS-1$ //$NON-NLS-2$
34473447
}
34483448
if (startPosition < 0 && length != 0) {
3449-
throw new IllegalArgumentException();
3449+
throw new IllegalArgumentException("negative startPosition=" + startPosition + " length=" + length); //$NON-NLS-1$ //$NON-NLS-2$
34503450
}
34513451
// source positions are not considered a structural property
34523452
// but we protect them nevertheless

0 commit comments

Comments
 (0)