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.69 by jsr166, Fri Aug 30 18:05:39 2019 UTC vs.
Revision 1.70 by jsr166, Fri Jan 10 21:32:08 2020 UTC

# Line 1139 | Line 1139 | public class ArrayList<E> extends Abstra
1139              this.parent = parent;
1140              this.offset = parent.offset + fromIndex;
1141              this.size = toIndex - fromIndex;
1142 <            this.modCount = root.modCount;
1142 >            this.modCount = parent.modCount;
1143          }
1144  
1145          public E set(int index, E element) {
# Line 1292 | Line 1292 | public class ArrayList<E> extends Abstra
1292              return new ListIterator<E>() {
1293                  int cursor = index;
1294                  int lastRet = -1;
1295 <                int expectedModCount = root.modCount;
1295 >                int expectedModCount = SubList.this.modCount;
1296  
1297                  public boolean hasNext() {
1298                      return cursor != SubList.this.size;
# Line 1336 | Line 1336 | public class ArrayList<E> extends Abstra
1336                          final Object[] es = root.elementData;
1337                          if (offset + i >= es.length)
1338                              throw new ConcurrentModificationException();
1339 <                        for (; i < size && modCount == expectedModCount; i++)
1339 >                        for (; i < size && root.modCount == expectedModCount; i++)
1340                              action.accept(elementAt(es, offset + i));
1341                          // update once at end to reduce heap write traffic
1342                          cursor = i;
# Line 1362 | Line 1362 | public class ArrayList<E> extends Abstra
1362                          SubList.this.remove(lastRet);
1363                          cursor = lastRet;
1364                          lastRet = -1;
1365 <                        expectedModCount = root.modCount;
1365 >                        expectedModCount = SubList.this.modCount;
1366                      } catch (IndexOutOfBoundsException ex) {
1367                          throw new ConcurrentModificationException();
1368                      }
# Line 1388 | Line 1388 | public class ArrayList<E> extends Abstra
1388                          SubList.this.add(i, e);
1389                          cursor = i + 1;
1390                          lastRet = -1;
1391 <                        expectedModCount = root.modCount;
1391 >                        expectedModCount = SubList.this.modCount;
1392                      } catch (IndexOutOfBoundsException ex) {
1393                          throw new ConcurrentModificationException();
1394                      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines