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

Paul Sandoz paul.sandoz at oracle.com
Mon Aug 12 12:22:42 UTC 2013


The following patch updates documentation for various spliterators in the j.u.concurrent package:


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();


More information about the core-libs-dev mailing list