RFR-8148748: ArrayList.subList().spliterator() is not late-binding

Martin Buchholz martinrb at google.com
Wed Feb 3 15:16:10 UTC 2016


On Wed, Feb 3, 2016 at 4:20 AM, Tagir F. Valeev <amaembo at gmail.com> wrote:

> Some more thoughts about forEachRemaining:
>
> To me it seems that
> if ((a = lst.elementData) != null)
> is a redundant check as well as in current ArrayList implementation
> elementData is never null. So it can be replaced with simple
> assignment.

The null check for something that is provably non-null is a sign of
the hand of Doug Lea.
I'm often tempted to try to remove them from j.u.concurrent as well,
but I resist.
They may help hotspot generate better code.



More information about the core-libs-dev mailing list