src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java
Print this page
*** 1398,1408 ****
public List<E> subList(int fromIndex, int toIndex) {
final ReentrantLock lock = l.lock;
lock.lock();
try {
checkForComodification();
! if (fromIndex < 0 || toIndex > size)
throw new IndexOutOfBoundsException();
return new COWSubList<E>(l, fromIndex + offset,
toIndex + offset);
} finally {
lock.unlock();
--- 1398,1408 ----
public List<E> subList(int fromIndex, int toIndex) {
final ReentrantLock lock = l.lock;
lock.lock();
try {
checkForComodification();
! if (fromIndex < 0 || toIndex > size || fromIndex > toIndex)
throw new IndexOutOfBoundsException();
return new COWSubList<E>(l, fromIndex + offset,
toIndex + offset);
} finally {
lock.unlock();