Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/util/concurrent/DelayQueue.java
          +++ new/src/share/classes/java/util/concurrent/DelayQueue.java
↓ open down ↓ 474 lines elided ↑ open up ↑
 475  475          try {
 476  476              return q.remove(o);
 477  477          } finally {
 478  478              lock.unlock();
 479  479          }
 480  480      }
 481  481  
 482  482      /**
 483  483       * Returns an iterator over all the elements (both expired and
 484  484       * unexpired) in this queue. The iterator does not return the
 485      -     * elements in any particular order.  The returned
 486      -     * <tt>Iterator</tt> is a "weakly consistent" iterator that will
 487      -     * never throw {@link ConcurrentModificationException}, and
 488      -     * guarantees to traverse elements as they existed upon
 489      -     * construction of the iterator, and may (but is not guaranteed
 490      -     * to) reflect any modifications subsequent to construction.
      485 +     * elements in any particular order.
 491  486       *
      487 +     * <p>The returned iterator is a "weakly consistent" iterator that
      488 +     * will never throw {@link java.util.ConcurrentModificationException
      489 +     * ConcurrentModificationException}, and guarantees to traverse
      490 +     * elements as they existed upon construction of the iterator, and
      491 +     * may (but is not guaranteed to) reflect any modifications
      492 +     * subsequent to construction.
      493 +     *
 492  494       * @return an iterator over the elements in this queue
 493  495       */
 494  496      public Iterator<E> iterator() {
 495  497          return new Itr(toArray());
 496  498      }
 497  499  
 498  500      /**
 499  501       * Snapshot iterator that works off copy of underlying q array.
 500  502       */
 501  503      private class Itr implements Iterator<E> {
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX