1077 |
|
public ListIterator<E> listIterator(final int index) { |
1078 |
|
Object[] elements = getArray(); |
1079 |
|
int len = elements.length; |
1080 |
< |
if (index<0 || index>len) |
1080 |
> |
if (index < 0 || index > len) |
1081 |
|
throw new IndexOutOfBoundsException("Index: "+index); |
1082 |
|
|
1083 |
|
return new COWIterator<E>(elements, index); |
1227 |
|
|
1228 |
|
// only call this holding l's lock |
1229 |
|
private void rangeCheck(int index) { |
1230 |
< |
if (index<0 || index>=size) |
1230 |
> |
if (index < 0 || index >= size) |
1231 |
|
throw new IndexOutOfBoundsException("Index: "+index+ |
1232 |
|
",Size: "+size); |
1233 |
|
} |
1274 |
|
lock.lock(); |
1275 |
|
try { |
1276 |
|
checkForComodification(); |
1277 |
< |
if (index<0 || index>size) |
1277 |
> |
if (index < 0 || index > size) |
1278 |
|
throw new IndexOutOfBoundsException(); |
1279 |
|
l.add(index+offset, element); |
1280 |
|
expectedArray = l.getArray(); |
1336 |
|
lock.lock(); |
1337 |
|
try { |
1338 |
|
checkForComodification(); |
1339 |
< |
if (index<0 || index>size) |
1339 |
> |
if (index < 0 || index > size) |
1340 |
|
throw new IndexOutOfBoundsException("Index: "+index+ |
1341 |
|
", Size: "+size); |
1342 |
|
return new COWSubListIterator<E>(l, index, offset, size); |
1350 |
|
lock.lock(); |
1351 |
|
try { |
1352 |
|
checkForComodification(); |
1353 |
< |
if (fromIndex<0 || toIndex>size) |
1353 |
> |
if (fromIndex < 0 || toIndex > size) |
1354 |
|
throw new IndexOutOfBoundsException(); |
1355 |
|
return new COWSubList<E>(l, fromIndex + offset, |
1356 |
|
toIndex + offset); |