109 |
|
public class ArrayList<E> extends AbstractList<E> |
110 |
|
implements List<E>, RandomAccess, Cloneable, java.io.Serializable |
111 |
|
{ |
112 |
+ |
// OPENJDK @java.io.Serial |
113 |
|
private static final long serialVersionUID = 8683452581122892189L; |
114 |
|
|
115 |
|
/** |
539 |
|
if (to > es.length) { |
540 |
|
throw new ConcurrentModificationException(); |
541 |
|
} |
542 |
< |
Iterator<?> oit = other.iterator(); |
542 |
> |
var oit = other.iterator(); |
543 |
|
for (; from < to; from++) { |
544 |
|
if (!oit.hasNext() || !Objects.equals(es[from], oit.next())) { |
545 |
|
return false; |
856 |
|
* instance is emitted (int), followed by all of its elements |
857 |
|
* (each an {@code Object}) in the proper order. |
858 |
|
*/ |
859 |
+ |
// OPENJDK @java.io.Serial |
860 |
|
private void writeObject(java.io.ObjectOutputStream s) |
861 |
|
throws java.io.IOException { |
862 |
|
// Write out element count, and any hidden stuff |
884 |
|
* could not be found |
885 |
|
* @throws java.io.IOException if an I/O error occurs |
886 |
|
*/ |
887 |
+ |
// OPENJDK @java.io.Serial |
888 |
|
private void readObject(java.io.ObjectInputStream s) |
889 |
|
throws java.io.IOException, ClassNotFoundException { |
890 |
|
|
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) { |
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; |
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; |
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 |
|
} |
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 |
|
} |