equal
deleted
inserted
replaced
1398 public List<E> subList(int fromIndex, int toIndex) { |
1398 public List<E> subList(int fromIndex, int toIndex) { |
1399 final ReentrantLock lock = l.lock; |
1399 final ReentrantLock lock = l.lock; |
1400 lock.lock(); |
1400 lock.lock(); |
1401 try { |
1401 try { |
1402 checkForComodification(); |
1402 checkForComodification(); |
1403 if (fromIndex < 0 || toIndex > size) |
1403 if (fromIndex < 0 || toIndex > size || fromIndex > toIndex) |
1404 throw new IndexOutOfBoundsException(); |
1404 throw new IndexOutOfBoundsException(); |
1405 return new COWSubList<E>(l, fromIndex + offset, |
1405 return new COWSubList<E>(l, fromIndex + offset, |
1406 toIndex + offset); |
1406 toIndex + offset); |
1407 } finally { |
1407 } finally { |
1408 lock.unlock(); |
1408 lock.unlock(); |