8075230: Optimized count operations incorrectly declare the stream shape
Reviewed-by: chegar
--- a/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Mon Mar 16 19:09:13 2015 +0400
+++ b/jdk/src/java.base/share/classes/java/util/stream/ReduceOps.java Mon Mar 16 17:44:34 2015 +0100
@@ -414,7 +414,7 @@
*/
public static TerminalOp<Integer, Long>
makeIntCounting() {
- return new ReduceOp<Integer, Long, CountingSink<Integer>>(StreamShape.REFERENCE) {
+ return new ReduceOp<Integer, Long, CountingSink<Integer>>(StreamShape.INT_VALUE) {
@Override
public CountingSink<Integer> makeSink() { return new CountingSink.OfInt(); }
@@ -583,7 +583,7 @@
*/
public static TerminalOp<Long, Long>
makeLongCounting() {
- return new ReduceOp<Long, Long, CountingSink<Long>>(StreamShape.REFERENCE) {
+ return new ReduceOp<Long, Long, CountingSink<Long>>(StreamShape.LONG_VALUE) {
@Override
public CountingSink<Long> makeSink() { return new CountingSink.OfLong(); }
@@ -752,7 +752,7 @@
*/
public static TerminalOp<Double, Long>
makeDoubleCounting() {
- return new ReduceOp<Double, Long, CountingSink<Double>>(StreamShape.REFERENCE) {
+ return new ReduceOp<Double, Long, CountingSink<Double>>(StreamShape.DOUBLE_VALUE) {
@Override
public CountingSink<Double> makeSink() { return new CountingSink.OfDouble(); }