--- jsr166/src/main/java/util/PriorityQueue.java 2010/09/05 21:32:19 1.71 +++ jsr166/src/main/java/util/PriorityQueue.java 2011/10/25 20:29:12 1.75 @@ -331,9 +331,7 @@ public class PriorityQueue extends Ab } public E peek() { - if (size == 0) - return null; - return (E) queue[0]; + return (size == 0) ? null : (E) queue[0]; } private int indexOf(Object o) { @@ -434,8 +432,7 @@ public class PriorityQueue extends Ab * The following code can be used to dump the queue into a newly * allocated array of String: * - *
-     *     String[] y = x.toArray(new String[0]);
+ *
 {@code String[] y = x.toArray(new String[0]);}
* * Note that toArray(new Object[0]) is identical in function to * toArray(). @@ -592,7 +589,7 @@ public class PriorityQueue extends Ab * avoid missing traversing elements. */ private E removeAt(int i) { - assert i >= 0 && i < size; + // assert i >= 0 && i < size; modCount++; int s = --size; if (s == i) // removed last element @@ -736,7 +733,7 @@ public class PriorityQueue extends Ab * @param s the stream */ private void writeObject(java.io.ObjectOutputStream s) - throws java.io.IOException{ + throws java.io.IOException { // Write out element count, and any hidden stuff s.defaultWriteObject();