# | Line 756 | Line 756 | public class CopyOnWriteArrayList<E> | |
---|---|---|
756 | */ | |
757 | public boolean addAll(int index, Collection<? extends E> c) { | |
758 | int numNew = c.size(); | |
759 | – | if (numNew == 0) |
760 | – | return false; |
759 | final ReentrantLock lock = this.lock; | |
760 | lock.lock(); | |
761 | try { | |
# | Line 766 | Line 764 | public class CopyOnWriteArrayList<E> | |
764 | if (index > len || index < 0) | |
765 | throw new IndexOutOfBoundsException("Index: "+index+ | |
766 | ", Size: "+len); | |
767 | + | if (numNew == 0) |
768 | + | return false; |
769 | int numMoved = len - index; | |
770 | Object[] newElements; | |
771 | if (numMoved == 0) |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |