ArrayList.java (addAll(int,Collection)): System.arraycopy all of the remaining elements.
* java/util/ArrayList.java (addAll(int,Collection)): System.arraycopy all of the remaining elements. * java/util/Vector.java (addAll(int,Collection)): Likewise. (removeRange): If toIndex == fromIndex do nothing, if toIndex < fromIndex throw IndexOutIfBoundsException. (removeAll): Always throw NullPointerException when collection is null. (retrainAll): Likewise. From-SVN: r51979
This commit is contained in:
parent
0154eaa812
commit
236fc6a041
3 changed files with 28 additions and 5 deletions
|
@ -427,8 +427,8 @@ public class ArrayList extends AbstractList
|
|||
if (csize + size > data.length)
|
||||
ensureCapacity(size + csize);
|
||||
int end = index + csize;
|
||||
if (index != size)
|
||||
System.arraycopy(data, index, data, end, csize);
|
||||
if (size > 0 && index != size)
|
||||
System.arraycopy(data, index, data, end, size - index);
|
||||
size += csize;
|
||||
for ( ; index < end; index++)
|
||||
data[index] = itr.next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue