22 |
|
import java.util.concurrent.locks.Condition; |
23 |
|
import java.util.concurrent.locks.ReentrantLock; |
24 |
|
import java.util.function.Consumer; |
25 |
+ |
import jdk.internal.misc.SharedSecrets; |
26 |
|
|
27 |
|
/** |
28 |
|
* An unbounded {@linkplain BlockingQueue blocking queue} that uses |
893 |
|
throws java.io.IOException, ClassNotFoundException { |
894 |
|
try { |
895 |
|
s.defaultReadObject(); |
896 |
< |
this.queue = new Object[q.size()]; |
896 |
> |
int sz = q.size(); |
897 |
> |
SharedSecrets.getJavaObjectInputStreamAccess().checkArray(s, Object[].class, sz); |
898 |
> |
this.queue = new Object[sz]; |
899 |
|
comparator = q.comparator(); |
900 |
|
addAll(q); |
901 |
|
} finally { |