71 |
* non-deterministic behavior. |
* non-deterministic behavior. |
72 |
* |
* |
73 |
* @author Jon A. Zeppieri |
* @author Jon A. Zeppieri |
74 |
|
* @author Bryce McKinlay |
75 |
* @author Eric Blake <ebb9@email.byu.edu> |
* @author Eric Blake <ebb9@email.byu.edu> |
76 |
* @see Collection |
* @see Collection |
77 |
* @see List |
* @see List |
464 |
// use of a negative index will cause an ArrayIndexOutOfBoundsException, |
// use of a negative index will cause an ArrayIndexOutOfBoundsException, |
465 |
// a subclass of the required exception, with no effort on our part. |
// a subclass of the required exception, with no effort on our part. |
466 |
if (index > size) |
if (index > size) |
467 |
throw new IndexOutOfBoundsException("Index: " + index + ", Size:" |
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " |
468 |
+ size); |
+ size); |
469 |
} |
} |
470 |
|
|
480 |
// use of a negative index will cause an ArrayIndexOutOfBoundsException, |
// use of a negative index will cause an ArrayIndexOutOfBoundsException, |
481 |
// a subclass of the required exception, with no effort on our part. |
// a subclass of the required exception, with no effort on our part. |
482 |
if (index >= size) |
if (index >= size) |
483 |
throw new IndexOutOfBoundsException("Index: " + index + ", Size:" |
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " |
484 |
+ size); |
+ size); |
485 |
} |
} |
486 |
|
|