RFR: 8180352: Add Stream.toList() method [v2]

Stuart Marks stuart.marks at oracle.com
Wed Nov 25 06:26:09 UTC 2020



On 11/18/20 3:55 AM, Florian Weimer wrote:
> I think it's also needed for an efficient null element check in
> List::copyOf.  I have a hunch that with the posted implementation, it
> would incorrectly produce an immutable list that contains null
> elements.

(Sorry for the delay; oddly, this comment didn't make it into the PR.)

Yes, there was a bug in List::copyOf in that it would pass through a list containing 
nulls, a clear violation of its spec. I fixed this in my second-most recent commit 
on this PR.

s'marks



More information about the core-libs-dev mailing list