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; |
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 |
|
/** |
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) |
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 |
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 |