提交 11fc13ca 编写于 作者: I igerasim

8189981: Improve queuing portability

Reviewed-by: skoivu, rhalade, chegar, igerasim
上级 e442d900
......@@ -48,6 +48,7 @@ import java.util.Queue;
import java.util.SortedSet;
import java.util.Spliterator;
import java.util.function.Consumer;
import sun.misc.SharedSecrets;
/**
* An unbounded {@linkplain BlockingQueue blocking queue} that uses
......@@ -940,7 +941,9 @@ public class PriorityBlockingQueue<E> extends AbstractQueue<E>
throws java.io.IOException, ClassNotFoundException {
try {
s.defaultReadObject();
this.queue = new Object[q.size()];
int sz = q.size();
SharedSecrets.getJavaOISAccess().checkArray(s, Object[].class, sz);
this.queue = new Object[sz];
comparator = q.comparator();
addAll(q);
} finally {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册