--- jsr166/src/main/java/util/ArrayList.java 2018/05/16 16:18:00 1.60 +++ jsr166/src/main/java/util/ArrayList.java 2019/05/02 14:31:30 1.66 @@ -28,7 +28,7 @@ package java.util; import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; -import jdk.internal.misc.SharedSecrets; +// OPENJDK import jdk.internal.access.SharedSecrets; /** * Resizable-array implementation of the {@code List} interface. Implements @@ -92,7 +92,7 @@ import jdk.internal.misc.SharedSecrets; * should be used only to detect bugs. * *

This class is a member of the - * + * * Java Collections Framework. * * @param the type of elements in this list @@ -571,7 +571,7 @@ public class ArrayList extends Abstra if (to > es.length) { throw new ConcurrentModificationException(); } - var oit = other.iterator(); + Iterator oit = other.iterator(); for (; from < to; from++) { if (!oit.hasNext() || !Objects.equals(es[from], oit.next())) { return false; @@ -926,7 +926,7 @@ public class ArrayList extends Abstra if (size > 0) { // like clone(), allocate array based upon size not capacity - SharedSecrets.getJavaObjectInputStreamAccess().checkArray(s, Object[].class, size); + jsr166.Platform.checkArray(s, Object[].class, size); Object[] elements = new Object[size]; // Read in all elements in the proper order. @@ -1737,6 +1737,8 @@ public class ArrayList extends Abstra @Override public void replaceAll(UnaryOperator operator) { replaceAllRange(operator, 0, size); + // TODO(8203662): remove increment of modCount from ... + modCount++; } private void replaceAllRange(UnaryOperator operator, int i, int end) {