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

Comparing jsr166/src/main/java/util/PriorityQueue.java (file contents):
Revision 1.25 by tim, Wed Aug 6 18:42:49 2003 UTC vs.
Revision 1.28 by dl, Wed Aug 13 14:11:59 2003 UTC

# Line 176 | Line 176 | public class PriorityQueue<E> extends Ab
176       */
177      public PriorityQueue(Collection<? extends E> c) {
178          initializeArray(c);
179 <        if (c instanceof SortedSet<? extends E>) {
180 <            SortedSet<? extends E> s = (SortedSet<? extends E>) c;
179 >        if (c instanceof SortedSet) {
180 >            // @fixme double-cast workaround for compiler
181 >            SortedSet<? extends E> s = (SortedSet<? extends E>) (SortedSet)c;
182              comparator = (Comparator<? super E>)s.comparator();
183              fillFromSorted(s);
184 <        }
184 <        else if (c instanceof PriorityQueue<? extends E>) {
184 >        } else if (c instanceof PriorityQueue) {
185              PriorityQueue<? extends E> s = (PriorityQueue<? extends E>) c;
186              comparator = (Comparator<? super E>)s.comparator();
187              fillFromSorted(s);
188 <        }
189 <        else {
188 >        } else {
189              comparator = null;
190              fillFromUnsorted(c);
191          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines