test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestScenario.java

Print this page
rev 7982 : 8017513: Support for closeable streams
8022237: j.u.s.BaseStream.onClose() has an issue in implementation or requires spec clarification
8022572: Same exception instances thrown from j.u.stream.Stream.onClose() handlers are not listed as suppressed
Summary: BaseStream implements AutoCloseable; Remove CloseableStream and DelegatingStream
Reviewed-by: alanb, mduigou, psandoz
Contributed-by: brian.goetz@oracle.com

*** 38,55 **** * the same output (modulo allowable differences in ordering). */ @SuppressWarnings({"rawtypes", "unchecked"}) public enum DoubleStreamTestScenario implements OpTestCase.BaseStreamTestScenario { ! STREAM_FOR_EACH(false) { <T, S_IN extends BaseStream<T, S_IN>> void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { DoubleStream s = m.apply(data.stream()); if (s.isParallel()) { s = s.sequential(); } s.forEach(b); } }, STREAM_TO_ARRAY(false) { <T, S_IN extends BaseStream<T, S_IN>> --- 38,56 ---- * the same output (modulo allowable differences in ordering). */ @SuppressWarnings({"rawtypes", "unchecked"}) public enum DoubleStreamTestScenario implements OpTestCase.BaseStreamTestScenario { ! STREAM_FOR_EACH_WITH_CLOSE(false) { <T, S_IN extends BaseStream<T, S_IN>> void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { DoubleStream s = m.apply(data.stream()); if (s.isParallel()) { s = s.sequential(); } s.forEach(b); + s.close(); } }, STREAM_TO_ARRAY(false) { <T, S_IN extends BaseStream<T, S_IN>>