Spliterator documentation on Priority(Blocking)Queue

Tagir Valeev amaembo at gmail.com
Tue Aug 4 04:47:38 UTC 2015


The PriorityQueue class iterator() returns elements in no particular order.
This is explicitly stated in JavaDoc for iterator() method [1] as well as
in class description [2]. However it's not mentioned mentioned that
spliterator() method also traverses the queue in no particular order. Well,
the user might guess that the order is not specified, because the
spliterator does not have ORDERED characteristic, but it's not so obvious
for any user. Probably it's would be good to add an explicit note like it's
done for iterator. The same thing is for PriorityBlockingQueue. What do you

With best regards,
Tagir Valeev.


More information about the core-libs-dev mailing list