RFR: 8032190 It's unclear that flatMap will ensure each stream will be closed.

Paul Sandoz paul.sandoz at oracle.com
Tue Jan 21 09:46:53 UTC 2014


On Jan 20, 2014, at 11:16 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 20/01/2014 10:38, Paul Sandoz wrote:
>> Hi,
>> 
>> For the flatMap operations of streams we forgot to say what it does with the mapped streams after it has processed them i.e. closes them, which is important for I/O backed streams (e.g. map Path ->  Stream<String>  for lines of a file). The following patch fixes that omission in the docs:
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8032190
>> 
>> I think this should be backported to 8.
>> 
>> Paul.
> This is important to add. A minor comment is to just link "closed" to BaseStream#close rather than adding "see ...".
> 

Good idea, i updated to do that.

Paul.


More information about the core-libs-dev mailing list