jdk/src/share/classes/java/util/ArrayList.java
changeset 51 6fe31bc95bbc
parent 2 90ce3da70b43
child 715 f16baef3a20e
equal deleted inserted replaced
50:a437b3f9d7f4 51:6fe31bc95bbc
   890 
   890 
   891     private class SubList extends AbstractList<E> implements RandomAccess {
   891     private class SubList extends AbstractList<E> implements RandomAccess {
   892         private final AbstractList<E> parent;
   892         private final AbstractList<E> parent;
   893         private final int parentOffset;
   893         private final int parentOffset;
   894         private final int offset;
   894         private final int offset;
   895         private int size;
   895         int size;
   896 
   896 
   897         SubList(AbstractList<E> parent,
   897         SubList(AbstractList<E> parent,
   898                 int offset, int fromIndex, int toIndex) {
   898                 int offset, int fromIndex, int toIndex) {
   899             this.parent = parent;
   899             this.parent = parent;
   900             this.parentOffset = fromIndex;
   900             this.parentOffset = fromIndex;
   969         }
   969         }
   970 
   970 
   971         public ListIterator<E> listIterator(final int index) {
   971         public ListIterator<E> listIterator(final int index) {
   972             checkForComodification();
   972             checkForComodification();
   973             rangeCheckForAdd(index);
   973             rangeCheckForAdd(index);
       
   974             final int offset = this.offset;
   974 
   975 
   975             return new ListIterator<E>() {
   976             return new ListIterator<E>() {
   976                 int cursor = index;
   977                 int cursor = index;
   977                 int lastRet = -1;
   978                 int lastRet = -1;
   978                 int expectedModCount = ArrayList.this.modCount;
   979                 int expectedModCount = ArrayList.this.modCount;