--- jsr166/src/main/java/util/PriorityQueue.java 2003/07/13 22:51:22 1.9 +++ jsr166/src/main/java/util/PriorityQueue.java 2003/07/26 13:17:51 1.10 @@ -31,7 +31,7 @@ * @author Josh Bloch */ public class PriorityQueue extends AbstractQueue - implements Queue, + implements Queue, java.io.Serializable { private static final int DEFAULT_INITIAL_CAPACITY = 11; @@ -97,7 +97,7 @@ public class PriorityQueue extends Ab public PriorityQueue(int initialCapacity, Comparator comparator) { if (initialCapacity < 1) initialCapacity = 1; - queue = new E[initialCapacity + 1]; + queue = (E[]) new Object[initialCapacity + 1]; this.comparator = comparator; } @@ -126,7 +126,7 @@ public class PriorityQueue extends Ab Integer.MAX_VALUE - 1); if (initialCapacity < 1) initialCapacity = 1; - queue = new E[initialCapacity + 1]; + queue = (E[]) new Object[initialCapacity + 1]; if (initialElements instanceof Sorted) { @@ -217,7 +217,7 @@ public class PriorityQueue extends Ab * elements of the priority queue will be returned by this iterator in the * order specified by the queue, which is to say the order they would be * returned by repeated calls to poll. - * + * * @return an Iterator over the elements in this priority queue. */ public Iterator iterator() { @@ -278,7 +278,7 @@ public class PriorityQueue extends Ab /** * Returns the number of elements in this priority queue. - * + * * @return the number of elements in this priority queue. */ public int size() { @@ -303,7 +303,7 @@ public class PriorityQueue extends Ab // Grow backing store if necessary while (size >= queue.length) { - E[] newQueue = new E[2 * queue.length]; + E[] newQueue = (E[]) new Object[2 * queue.length]; System.arraycopy(queue, 0, newQueue, 0, queue.length); queue = newQueue; } @@ -451,7 +451,7 @@ public class PriorityQueue extends Ab // Read in array length and allocate array int arrayLength = s.readInt(); - queue = new E[arrayLength]; + queue = (E[]) new Object[arrayLength]; // Read in all elements in the proper order. for (int i=0; i