RFR: 8180352: Add Stream.toList() method

Martin Desruisseaux martin.desruisseaux at geomatys.com
Tue Nov 3 22:16:49 UTC 2020


Hello

Le 03/11/2020 à 21:30, forax at univ-mlv.fr a écrit :

> You know that you can not change the implementation of 
> Collectors.toList(), and you also know that if there is a method 
> Stream.toList(), people will replace the calls to 
> .collect(Collectors.toList()) by a call to Stream.toList() for the 
> very same reason (…snip…)
>
Would they would be so numerous to do this change without verifying if 
the specifications match? (on my side I do read the method javadoc). But 
even if we worry about developers not reading javadoc, the argument 
could go both ways: they could assume that all Stream methods accepts 
null and not read that Stream.toList() specifies otherwise.

     Martin




More information about the core-libs-dev mailing list