changeset 8466:e014a447a0a2

Revert workarounds for JDK-8011591
author briangoetz
date Tue, 07 May 2013 12:01:46 -0400
parents 95cfe3e46610
children 056b1f9f4443
files src/share/classes/java/util/stream/MatchOps.java
diffstat 1 files changed, 4 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/MatchOps.java	Tue May 07 16:17:05 2013 +0200
+++ b/src/share/classes/java/util/stream/MatchOps.java	Tue May 07 12:01:46 2013 -0400
@@ -94,12 +94,7 @@
             }
         }
 
-        // @@@ Workaround for JDK-8011591 -- when fixed, replace s with constructor ref
-        Supplier<BooleanTerminalSink<T>> s = new Supplier<BooleanTerminalSink<T>>() {
-            @Override
-            public BooleanTerminalSink<T> get() {return new MatchSink();}
-        };
-        return new MatchOp<>(StreamShape.REFERENCE, matchKind, s);
+        return new MatchOp<>(StreamShape.REFERENCE, matchKind, MatchSink::new);
     }
 
     /**
@@ -128,12 +123,7 @@
             }
         }
 
-        // @@@ Workaround for JDK-8011591 -- when fixed, replace s with constructor ref
-        Supplier<BooleanTerminalSink<Integer>> s = new Supplier<BooleanTerminalSink<Integer>>() {
-            @Override
-            public BooleanTerminalSink<Integer> get() {return new MatchSink();}
-        };
-        return new MatchOp<>(StreamShape.INT_VALUE, matchKind, s);
+        return new MatchOp<>(StreamShape.INT_VALUE, matchKind, MatchSink::new);
     }
 
     /**
@@ -163,12 +153,7 @@
             }
         }
 
-        // @@@ Workaround for JDK-8011591 -- when fixed, replace s with constructor ref
-        Supplier<BooleanTerminalSink<Long>> s = new Supplier<BooleanTerminalSink<Long>>() {
-            @Override
-            public BooleanTerminalSink<Long> get() {return new MatchSink();}
-        };
-        return new MatchOp<>(StreamShape.LONG_VALUE, matchKind, s);
+        return new MatchOp<>(StreamShape.LONG_VALUE, matchKind, MatchSink::new);
     }
 
     /**
@@ -198,12 +183,7 @@
             }
         }
 
-        // @@@ Workaround for JDK-8011591 -- when fixed, replace s with constructor ref
-        Supplier<BooleanTerminalSink<Double>> s = new Supplier<BooleanTerminalSink<Double>>() {
-            @Override
-            public BooleanTerminalSink<Double> get() {return new MatchSink();}
-        };
-        return new MatchOp<>(StreamShape.DOUBLE_VALUE, matchKind, s);
+        return new MatchOp<>(StreamShape.DOUBLE_VALUE, matchKind, MatchSink::new);
     }
 
     /**