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.7 by dl, Sat Nov 26 17:35:19 2005 UTC vs.
Revision 1.8 by jsr166, Sat Nov 26 20:39:51 2005 UTC

# Line 388 | Line 388 | public class ArrayList<E> extends Abstra
388       * @return <tt>true</tt> (as specified by {@link Collection#add})
389       */
390      public boolean add(E e) {
391 <        ++modCount;
391 >        modCount++;
392          int s = size;
393          if (s >= elementData.length)
394              growArray(s + 1);
# Line 410 | Line 410 | public class ArrayList<E> extends Abstra
410          int s = size;
411          if (index > s || index < 0)
412              rangeException(index, s);
413 <        ++modCount;
413 >        modCount++;
414          if (s >= elementData.length)
415              growArray(s + 1);
416          System.arraycopy(elementData, index,
# Line 430 | Line 430 | public class ArrayList<E> extends Abstra
430       */
431      public E remove(int index) {
432          int s = size - 1;
433 <        if (index < 0 || index > s)
433 >        if (index > s)
434              rangeException(index, size);
435          modCount++;
436          E oldValue = (E)elementData[index];
# Line 438 | Line 438 | public class ArrayList<E> extends Abstra
438          if (numMoved > 0)
439              System.arraycopy(elementData, index + 1,
440                               elementData, index, numMoved);
441 <        elementData[s] = null; // forget removed element
441 >        elementData[s] = null;
442          size = s;
443          return oldValue;
444      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines