964 |
|
public ListIterator<E> listIterator(final int index) { |
965 |
|
Object[] elements = getArray(); |
966 |
|
int len = elements.length; |
967 |
< |
if (index<0 || index>len) |
967 |
> |
if (index < 0 || index > len) |
968 |
|
throw new IndexOutOfBoundsException("Index: "+index); |
969 |
|
|
970 |
|
return new COWIterator<E>(elements, index); |
1109 |
|
|
1110 |
|
// only call this holding l's lock |
1111 |
|
private void rangeCheck(int index) { |
1112 |
< |
if (index<0 || index>=size) |
1112 |
> |
if (index < 0 || index >= size) |
1113 |
|
throw new IndexOutOfBoundsException("Index: "+index+ |
1114 |
|
",Size: "+size); |
1115 |
|
} |
1156 |
|
lock.lock(); |
1157 |
|
try { |
1158 |
|
checkForComodification(); |
1159 |
< |
if (index<0 || index>size) |
1159 |
> |
if (index < 0 || index > size) |
1160 |
|
throw new IndexOutOfBoundsException(); |
1161 |
|
l.add(index+offset, element); |
1162 |
|
expectedArray = l.getArray(); |
1218 |
|
lock.lock(); |
1219 |
|
try { |
1220 |
|
checkForComodification(); |
1221 |
< |
if (index<0 || index>size) |
1221 |
> |
if (index < 0 || index > size) |
1222 |
|
throw new IndexOutOfBoundsException("Index: "+index+ |
1223 |
|
", Size: "+size); |
1224 |
|
return new COWSubListIterator<E>(l, index, offset, size); |
1232 |
|
lock.lock(); |
1233 |
|
try { |
1234 |
|
checkForComodification(); |
1235 |
< |
if (fromIndex<0 || toIndex>size) |
1235 |
> |
if (fromIndex < 0 || toIndex > size) |
1236 |
|
throw new IndexOutOfBoundsException(); |
1237 |
|
return new COWSubList<E>(l, fromIndex + offset, |
1238 |
|
toIndex + offset); |