RFR 8022318: Document Spliterator characteristics and binding policy of java util concurrent collection impls

Chris Hegarty chris.hegarty at oracle.com
Fri Aug 16 12:56:42 UTC 2013


Looks ok to me.

-Chris.

On 12/08/2013 13:22, Paul Sandoz wrote:
> Hi,
>
> The following patch updates documentation for various spliterators in the j.u.concurrent package:
>
>    http://cr.openjdk.java.net/~psandoz/tl/JDK-8022318-concurrent-split-docs/webrev/
>
> This syncs from the 166 repo and the documentation is just clarifying stuff that was missing.  Many thanks to Martin for helping out with this.
>
> There are a few additional tweaks here and there that are included, the only non-formating/non-documentation tweak is to SynchronousQueue.iterator():
>
> -    @SuppressWarnings("unchecked")
>       public Iterator<E>  iterator() {
> -        return (Iterator<E>) EmptyIterator.EMPTY_ITERATOR;
> -    }
> -
> -    // Replicated from a previous version of Collections
> -    private static class EmptyIterator<E>  implements Iterator<E>  {
> -        static final EmptyIterator<Object>  EMPTY_ITERATOR
> -            = new EmptyIterator<Object>();
> -
> -        public boolean hasNext() { return false; }
> -        public E next() { throw new NoSuchElementException(); }
> -        public void remove() { throw new IllegalStateException(); }
> +        return Collections.emptyIterator();
>       }
>
> Paul.



More information about the core-libs-dev mailing list