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

Comparing jsr166/src/main/java/util/concurrent/SynchronousQueue.java (file contents):
Revision 1.75 by jsr166, Tue Mar 15 19:47:03 2011 UTC vs.
Revision 1.76 by dl, Sat May 7 12:22:08 2011 UTC

# Line 1036 | Line 1036 | public class SynchronousQueue<E> extends
1036       *
1037       * @return an empty iterator
1038       */
1039 +    @SuppressWarnings("unchecked")
1040      public Iterator<E> iterator() {
1041 <        return Collections.emptyIterator();
1041 >        return (Iterator<E>) EmptyIterator.EMPTY_ITERATOR;
1042 >    }
1043 >
1044 >    // Replicated from a previous version of Collections
1045 >    private static class EmptyIterator<E> implements Iterator<E> {
1046 >        static final EmptyIterator<Object> EMPTY_ITERATOR
1047 >            = new EmptyIterator<Object>();
1048 >
1049 >        public boolean hasNext() { return false; }
1050 >        public E next() { throw new NoSuchElementException(); }
1051 >        public void remove() { throw new IllegalStateException(); }
1052      }
1053  
1054      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines