--- jsr166/src/main/java/util/ArrayDeque.java 2018/02/24 22:04:18 1.133 +++ jsr166/src/main/java/util/ArrayDeque.java 2019/08/30 18:05:38 1.138 @@ -8,8 +8,7 @@ package java.util; import java.io.Serializable; 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 {@link Deque} interface. Array @@ -51,7 +50,7 @@ import jdk.internal.misc.SharedSecrets; * Iterator} interfaces. * *

This class is a member of the - * + * * Java Collections Framework. * * @author Josh Bloch and Doug Lea @@ -181,7 +180,7 @@ public class ArrayDeque extends Abstr * sufficient to hold 16 elements. */ public ArrayDeque() { - elements = new Object[16]; + elements = new Object[16 + 1]; } /** @@ -917,7 +916,7 @@ public class ArrayDeque extends Abstr * @param operator the operator to apply to each element * @since TBD */ - /* public */ void replaceAll(UnaryOperator operator) { + /* public */ void replaceAll(java.util.function.UnaryOperator operator) { Objects.requireNonNull(operator); final Object[] es = elements; for (int i = head, end = tail, to = (i <= end) ? end : es.length; @@ -1199,6 +1198,7 @@ public class ArrayDeque extends Abstr } } + // OPENJDK @java.io.Serial private static final long serialVersionUID = 2340985798034038923L; /** @@ -1210,6 +1210,7 @@ public class ArrayDeque extends Abstr * followed by all of its elements (each an object reference) in * first-to-last order. */ + // OPENJDK @java.io.Serial private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); @@ -1234,13 +1235,14 @@ public class ArrayDeque extends Abstr * could not be found * @throws java.io.IOException if an I/O error occurs */ + // OPENJDK @java.io.Serial private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); // Read in size and allocate array int size = s.readInt(); - SharedSecrets.getJavaObjectInputStreamAccess().checkArray(s, Object[].class, size + 1); + jsr166.Platform.checkArray(s, Object[].class, size + 1); elements = new Object[size + 1]; this.tail = size;