On Wed, 18 Oct 2023 09:12:23 GMT, Chen Liang <li...@openjdk.org> wrote:
>> src/java.base/share/classes/java/util/function/UnaryOperator.java line 68: >> >>> 66: * @see Function#andThen(Function) >>> 67: */ >>> 68: default UnaryOperator<T> andThenUnary(UnaryOperator<T> after) { >> >> What are your comments on this proposed method? > > Just curious, do we have any idea how extensively `UnaryOperator` is used as > a parameter type in user code compared to plain `Function<T, T>`? If it's not > preferred over `Function<T, T>`, this new method might not be very useful. Generally speaking, there are 1,594 usages of `Function` and 208 usages of `UnaryFunction` in the JDK itself. More specifically, there are 8 usages of `Function::andThen` and zero use of `UnaryOperator::andThen` in the JDK. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16213#discussion_r1363544378