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

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.59 by dl, Sun Oct 10 21:43:15 2010 UTC vs.
Revision 1.60 by dl, Mon Oct 11 10:24:02 2010 UTC

# 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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines