--- jsr166/src/main/java/util/AbstractQueue.java 2006/03/03 17:15:06 1.33 +++ jsr166/src/main/java/util/AbstractQueue.java 2009/09/01 22:28:19 1.36 @@ -12,21 +12,20 @@ package java.util; * the base implementation does not allow null * elements. Methods {@link #add add}, {@link #remove remove}, and * {@link #element element} are based on {@link #offer offer}, {@link - * #poll poll}, and {@link #peek peek}, respectively but throw + * #poll poll}, and {@link #peek peek}, respectively, but throw * exceptions instead of indicating failure via false or * null returns. * - *

A Queue implementation that extends this class must + *

A Queue implementation that extends this class must * minimally define a method {@link Queue#offer} which does not permit * insertion of null elements, along with methods {@link - * Queue#peek}, {@link Queue#poll}, {@link Collection#size}, and a - * {@link Collection#iterator} supporting {@link - * Iterator#remove}. Typically, additional methods will be overridden - * as well. If these requirements cannot be met, consider instead - * subclassing {@link AbstractCollection}. + * Queue#peek}, {@link Queue#poll}, {@link Collection#size}, and + * {@link Collection#iterator}. Typically, additional methods will be + * overridden as well. If these requirements cannot be met, consider + * instead subclassing {@link AbstractCollection}. * *

This class is a member of the - * + * * Java Collections Framework. * * @since 1.5 @@ -155,11 +154,9 @@ public abstract class AbstractQueue if (c == this) throw new IllegalArgumentException(); boolean modified = false; - Iterator e = c.iterator(); - while (e.hasNext()) { - if (add(e.next())) + for (E e : c) + if (add(e)) modified = true; - } return modified; }