-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: None
-
Component/s: core-libs
ArrayDeque.addElements and ArrayDeque(Collection) uses a lambda method reference in the internal copyElements method:
private void copyElements(Collection<? extends E> c) {
c.forEach(this::addLast);
}
Since ArrayDeque may be used in early bootstrap code, it would make sense to change this lambda invocation to use a simple loop instead.
Performance should be neutral, see discussion in https://mail.openjdk.org/pipermail/core-libs-dev/2026-February/159362.html
private void copyElements(Collection<? extends E> c) {
c.forEach(this::addLast);
}
Since ArrayDeque may be used in early bootstrap code, it would make sense to change this lambda invocation to use a simple loop instead.
Performance should be neutral, see discussion in https://mail.openjdk.org/pipermail/core-libs-dev/2026-February/159362.html
- links to
-
Review(master)
openjdk/jdk/29894