ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/PriorityQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/PriorityQueue.java (file contents):
Revision 1.131 by jsr166, Wed May 22 17:36:58 2019 UTC vs.
Revision 1.134 by jsr166, Fri Jul 24 20:57:26 2020 UTC

# Line 87 | Line 87 | import jdk.internal.util.ArraysSupport;
87   public class PriorityQueue<E> extends AbstractQueue<E>
88      implements java.io.Serializable {
89  
90 +    // OPENJDK @java.io.Serial
91      private static final long serialVersionUID = -7720805057305804111L;
92  
93      private static final int DEFAULT_INITIAL_CAPACITY = 11;
# Line 110 | Line 111 | public class PriorityQueue<E> extends Ab
111       * The comparator, or null if priority queue uses elements'
112       * natural ordering.
113       */
114 +    @SuppressWarnings("serial") // Conditionally serializable
115      private final Comparator<? super E> comparator;
116  
117      /**
# Line 261 | Line 263 | public class PriorityQueue<E> extends Ab
263      private void initElementsFromCollection(Collection<? extends E> c) {
264          Object[] es = c.toArray();
265          int len = es.length;
266 <        // If c.toArray incorrectly doesn't return Object[], copy it.
265 <        if (es.getClass() != Object[].class)
266 >        if (c.getClass() != ArrayList.class)
267              es = Arrays.copyOf(es, len, Object[].class);
268          if (len == 1 || this.comparator != null)
269              for (Object e : es)
# Line 755 | Line 756 | public class PriorityQueue<E> extends Ab
756       *             emitted (int), followed by all of its elements
757       *             (each an {@code Object}) in the proper order.
758       */
759 +    // OPENJDK @java.io.Serial
760      private void writeObject(java.io.ObjectOutputStream s)
761          throws java.io.IOException {
762          // Write out element count, and any hidden stuff
# Line 778 | Line 780 | public class PriorityQueue<E> extends Ab
780       *         could not be found
781       * @throws java.io.IOException if an I/O error occurs
782       */
783 +    // OPENJDK @java.io.Serial
784      private void readObject(java.io.ObjectInputStream s)
785          throws java.io.IOException, ClassNotFoundException {
786          // Read in size, and any hidden stuff

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines