jdk/src/share/classes/java/util/stream/LongStream.java
changeset 19800 6e1fef53ea55
parent 19214 e5901820c3c1
child 19850 93b368e54c1c
--- a/jdk/src/share/classes/java/util/stream/LongStream.java	Tue Sep 03 11:44:34 2013 -0700
+++ b/jdk/src/share/classes/java/util/stream/LongStream.java	Tue Sep 03 12:16:01 2013 -0700
@@ -812,7 +812,8 @@
      * elements of a first {@code LongStream} succeeded by all the elements of the
      * second {@code LongStream}. The resulting stream is ordered if both
      * of the input streams are ordered, and parallel if either of the input
-     * streams is parallel.
+     * streams is parallel.  When the resulting stream is closed, the close
+     * handlers for both input streams are invoked.
      *
      * @param a the first stream
      * @param b the second stream to concatenate on to end of the first stream
@@ -824,7 +825,8 @@
 
         Spliterator.OfLong split = new Streams.ConcatSpliterator.OfLong(
                 a.spliterator(), b.spliterator());
-        return StreamSupport.longStream(split, a.isParallel() || b.isParallel());
+        LongStream stream = StreamSupport.longStream(split, a.isParallel() || b.isParallel());
+        return stream.onClose(Streams.composedClose(a, b));
     }
 
     /**