ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/ArrayList.java
(Generate patch)

Comparing jsr166/src/main/java/util/ArrayList.java (file contents):
Revision 1.9 by dl, Sun Nov 27 14:54:23 2005 UTC vs.
Revision 1.10 by jsr166, Mon Nov 28 02:35:46 2005 UTC

# Line 189 | Line 189 | public class ArrayList<E> extends Abstra
189       * @param minCapacity the desired minimum capacity
190       */
191      private void growArray(int minCapacity) {
192 <        if (minCapacity < 0)
192 >        if (minCapacity < 0)
193              throw new OutOfMemoryError(); // int overflow
194          int oldCapacity = elementData.length;
195          // Double size if small; else grow by 50%
# Line 414 | Line 414 | public class ArrayList<E> extends Abstra
414          modCount++;
415          if (s >= elementData.length)
416              growArray(s + 1);
417 <        System.arraycopy(elementData, index,
417 >        System.arraycopy(elementData, index,
418                           elementData, index + 1, s - index);
419          elementData[index] = element;
420          size = s + 1;
# Line 437 | Line 437 | public class ArrayList<E> extends Abstra
437          E oldValue = (E)elementData[index];
438          int numMoved = s - index;
439          if (numMoved > 0)
440 <            System.arraycopy(elementData, index + 1,
440 >            System.arraycopy(elementData, index + 1,
441                               elementData, index, numMoved);
442          elementData[s] = null;
443          size = s;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines