-
Bug
-
Resolution: Fixed
-
P4
-
21
The JEP for sequenced collection (https://openjdk.org/jeps/431) would add addFirst(), removeFirst() and reversed() methods to lists.
However, the Javadoc of List mentions:
> The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.
...
... this should be updated to include that reversed() runs in constant time while addFirst() and removeFirst() run in linear time.
See: https://mail.openjdk.org/pipermail/core-libs-dev/2023-June/107328.html
However, the Javadoc of List mentions:
> The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.
...
... this should be updated to include that reversed() runs in constant time while addFirst() and removeFirst() run in linear time.
See: https://mail.openjdk.org/pipermail/core-libs-dev/2023-June/107328.html
- csr for
-
JDK-8313723 Add performance information to ArrayList javadoc
- Closed