# | Line 876 | Line 876 | public class PriorityBlockingQueue<E> ex | |
---|---|---|
876 | throws java.io.IOException { | |
877 | lock.lock(); | |
878 | try { | |
879 | < | q = new PriorityQueue<E>(size, comparator); |
879 | > | int n = size; // avoid zero capacity argument |
880 | > | q = new PriorityQueue<E>(n == 0 ? 1 : n, comparator); |
881 | q.addAll(this); | |
882 | s.defaultWriteObject(); | |
883 | q = null; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |