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

Comparing jsr166/src/jdk7/java/util/concurrent/CopyOnWriteArrayList.java (file contents):
Revision 1.3 by jsr166, Fri Jan 18 04:23:27 2013 UTC vs.
Revision 1.4 by jsr166, Sun Jul 14 22:29:33 2013 UTC

# Line 964 | Line 964 | public class CopyOnWriteArrayList<E>
964      public ListIterator<E> listIterator(final int index) {
965          Object[] elements = getArray();
966          int len = elements.length;
967 <        if (index<0 || index>len)
967 >        if (index < 0 || index > len)
968              throw new IndexOutOfBoundsException("Index: "+index);
969  
970          return new COWIterator<E>(elements, index);
# Line 1109 | Line 1109 | public class CopyOnWriteArrayList<E>
1109  
1110          // only call this holding l's lock
1111          private void rangeCheck(int index) {
1112 <            if (index<0 || index>=size)
1112 >            if (index < 0 || index >= size)
1113                  throw new IndexOutOfBoundsException("Index: "+index+
1114                                                      ",Size: "+size);
1115          }
# Line 1156 | Line 1156 | public class CopyOnWriteArrayList<E>
1156              lock.lock();
1157              try {
1158                  checkForComodification();
1159 <                if (index<0 || index>size)
1159 >                if (index < 0 || index > size)
1160                      throw new IndexOutOfBoundsException();
1161                  l.add(index+offset, element);
1162                  expectedArray = l.getArray();
# Line 1218 | Line 1218 | public class CopyOnWriteArrayList<E>
1218              lock.lock();
1219              try {
1220                  checkForComodification();
1221 <                if (index<0 || index>size)
1221 >                if (index < 0 || index > size)
1222                      throw new IndexOutOfBoundsException("Index: "+index+
1223                                                          ", Size: "+size);
1224                  return new COWSubListIterator<E>(l, index, offset, size);
# Line 1232 | Line 1232 | public class CopyOnWriteArrayList<E>
1232              lock.lock();
1233              try {
1234                  checkForComodification();
1235 <                if (fromIndex<0 || toIndex>size)
1235 >                if (fromIndex < 0 || toIndex > size)
1236                      throw new IndexOutOfBoundsException();
1237                  return new COWSubList<E>(l, fromIndex + offset,
1238                                           toIndex + offset);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines