-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
The current behavior of the LinkedBlockingDeque is already constant time for iterator.remove().
-
Java API
-
SE
Summary
Change the JavaDoc of LinkedBlockingDeque to be more precise about the linear cost of iterator.remove().
Problem
The JavaDoc states that the cost of iterator.remove() is linear, but a LBD would need doubly-linked nodes, which should be able to remove a node in constant time. The cost would likely be linear in LinkedBlockingQueue, but not in LinkedBlockingDeque.
Solution
Change the JavaDoc to remove the reference to iterator.remove() as being linear cost.
Specification
Change the text of the JavaDoc in LinkedBlockingDeque to the following:
* <p>Most operations run in constant time (ignoring time spent
* blocking). Exceptions include {@link #remove(Object) remove},
* {@link #removeFirstOccurrence removeFirstOccurrence}, {@link
* #removeLastOccurrence removeLastOccurrence}, {@link #contains
* contains}, and the bulk operations, all of which run in linear
* time.
- csr of
-
JDK-8354111 JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque
-
- Open
-