--- old/src/share/classes/java/util/stream/DoublePipeline.java 2013-07-10 14:11:43.667135619 -0700 +++ new/src/share/classes/java/util/stream/DoublePipeline.java 2013-07-10 14:11:43.487135622 -0700 @@ -265,10 +265,11 @@ @Override public void accept(double t) { - // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it - DoubleStream result = mapper.apply(t); - if (result != null) - result.sequential().forEach(i -> downstream.accept(i)); + try (DoubleStream result = mapper.apply(t)) { + // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it + if (result != null) + result.sequential().forEach(i -> downstream.accept(i)); + } } }; }