提交 9a61dcd4 编写于 作者: M mduigou

8014316: Use Method Refs in j.u.stream.MatchOps

Reviewed-by: dholmes
上级 fc9c54b2
......@@ -94,12 +94,7 @@ final class MatchOps {
}
}
// @@@ 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 @@ final class MatchOps {
}
}
// @@@ 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 @@ final class MatchOps {
}
}
// @@@ 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 @@ final class MatchOps {
}
}
// @@@ 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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册