--- old/src/share/classes/java/util/function/BinaryOperator.java 2012-12-04 21:26:52.472643268 -0800 +++ new/src/share/classes/java/util/function/BinaryOperator.java 2012-12-04 21:26:52.260643258 -0800 @@ -35,9 +35,9 @@ public interface BinaryOperator { /** - * Returns the result of the operation upon the operands. - * The operands are named {@code left} and {@code right} for operations - * where the order of operands matters. + * Returns the result of the operation upon the operands. The operands are + * named {@code left} and {@code right} for operations where the order of + * operands matters. * * @param left the left operand * @param right the right operand --- old/src/share/classes/java/util/function/DoubleBinaryOperator.java 2012-12-04 21:26:53.136643300 -0800 +++ new/src/share/classes/java/util/function/DoubleBinaryOperator.java 2012-12-04 21:26:52.928643290 -0800 @@ -27,12 +27,27 @@ /** * An operation on two {@code double} operands yielding a {@code double} result. * + *

This is the primitive type specialization of {@link BinaryOperator} for + * {@code double} and also may be used as a {@code BinaryOperator}. When + * used as a {@code BinaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface DoubleBinaryOperator /* extends BinaryOperator */ { -// -// @Override -// public default Double operate(Double left, Double right) { return operateAsDouble((double) left, (double) right); } +public interface DoubleBinaryOperator extends BinaryOperator { + + /** + * {@inheritDoc} + * + * @param left {@inheritDoc}, must be non-null + * @param right {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Double operate(Double left, Double right) { + return operateAsDouble((double)left, (double)right); + } /** * Returns the {@code double} result of the operation upon the --- old/src/share/classes/java/util/function/DoubleBlock.java 2012-12-04 21:26:53.816643333 -0800 +++ new/src/share/classes/java/util/function/DoubleBlock.java 2012-12-04 21:26:53.608643323 -0800 @@ -29,11 +29,23 @@ * external state. * *

This is the primitive type specialization of {@link Block} for - * {@code double} and also may be used as a {@code Block}. + * {@code double} and also may be used as a {@code Block}. When used as + * a {@code Block} the default {@code accept} implementation provided by this + * interface does not accept null parameters. * * @since 1.8 */ -public interface DoubleBlock { +public interface DoubleBlock extends Block { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + */ + @Override + public default void accept(Double t) { + accept((double)t); + } /** * Use the {@code double} input value in an operation which may modify --- old/src/share/classes/java/util/function/DoubleFunction.java 2012-12-04 21:26:54.480643365 -0800 +++ new/src/share/classes/java/util/function/DoubleFunction.java 2012-12-04 21:26:54.272643355 -0800 @@ -28,11 +28,26 @@ * Apply a function to the input object yielding an appropriate {@code double} * value; this is the {@code double}-bearing specialization for {@link Function}. * + *

When used as a {@code Function} the default {@code apply} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @param the type of input objects to the function * * @since 1.8 */ -public interface DoubleFunction { +public interface DoubleFunction extends Function { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Double apply(T t) { + return applyAsDouble(t); + } /** * Apply a function to the input object yielding an appropriate --- old/src/share/classes/java/util/function/DoubleSupplier.java 2012-12-04 21:26:55.144643397 -0800 +++ new/src/share/classes/java/util/function/DoubleSupplier.java 2012-12-04 21:26:54.936643387 -0800 @@ -32,7 +32,15 @@ * * @since 1.8 */ -public interface DoubleSupplier { +public interface DoubleSupplier extends Supplier { + + /** + * {@inheritDoc} + */ + @Override + public default Double get() { + return getAsDouble(); + } /** * Returns a {@code double} value. --- old/src/share/classes/java/util/function/DoubleUnaryOperator.java 2012-12-04 21:26:55.808643430 -0800 +++ new/src/share/classes/java/util/function/DoubleUnaryOperator.java 2012-12-04 21:26:55.600643420 -0800 @@ -28,9 +28,26 @@ * An operation on a single {@code double} operand yielding a {@code double} * result. * + *

This is the primitive type specialization of {@link UnaryOperator} for + * {@code double} and also may be used as a {@code UnaryOperator}. When + * used as a {@code UnaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface DoubleUnaryOperator { +public interface DoubleUnaryOperator extends UnaryOperator { + + /** + * {@inheritDoc} + * + * @param operand {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Double operate(Double operand) { + return operateAsDouble((double)operand); + } /** * Returns the {@code double} result of the operation upon the --- old/src/share/classes/java/util/function/IntBinaryOperator.java 2012-12-04 21:26:56.472643462 -0800 +++ new/src/share/classes/java/util/function/IntBinaryOperator.java 2012-12-04 21:26:56.264643452 -0800 @@ -27,9 +27,27 @@ /** * An operation on two {@code int} operands yielding an {@code int} result. * + *

This is the primitive type specialization of {@link BinaryOperator} for + * {@code int} and also may be used as a {@code BinaryOperator}. When + * used as a {@code BinaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface IntBinaryOperator { +public interface IntBinaryOperator extends BinaryOperator { + + /** + * {@inheritDoc} + * + * @param left {@inheritDoc}, must be non-null + * @param right {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Integer operate(Integer left, Integer right) { + return operateAsInt((int)left, (int)right); + } /** * Returns the {@code int} result of the operation upon the {@code int} --- old/src/share/classes/java/util/function/IntBlock.java 2012-12-04 21:26:57.144643494 -0800 +++ new/src/share/classes/java/util/function/IntBlock.java 2012-12-04 21:26:56.936643484 -0800 @@ -29,11 +29,23 @@ * external state. * *

This is the primitive type specialization of {@link Block} for - * {@code int} and also may be used as a {@code Block}. + * {@code int} and also may be used as a {@code Block}. When used as + * a {@code Block} the default {@code accept} implementation provided by this + * interface does not accept null parameters. * * @since 1.8 */ -public interface IntBlock { +public interface IntBlock extends Block { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + */ + @Override + public default void accept(Integer t) { + accept((int) t); + } /** * Use the {@code int} input value in an operation which may modify external --- old/src/share/classes/java/util/function/IntFunction.java 2012-12-04 21:26:57.812643527 -0800 +++ new/src/share/classes/java/util/function/IntFunction.java 2012-12-04 21:26:57.604643517 -0800 @@ -28,11 +28,26 @@ * Apply a function to the input object yielding an appropriate {@code int} * value; this is the {@code int}-bearing specialization for {@link Function}. * + *

When used as a {@code Function} the default {@code apply} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @param the type of input objects to the function * * @since 1.8 */ -public interface IntFunction { +public interface IntFunction extends Function { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Integer apply(T t) { + return applyAsInt(t); + } /** * Apply a function to the input object yielding an appropriate {@code int} --- old/src/share/classes/java/util/function/IntSupplier.java 2012-12-04 21:26:58.472643559 -0800 +++ new/src/share/classes/java/util/function/IntSupplier.java 2012-12-04 21:26:58.268643549 -0800 @@ -27,12 +27,20 @@ /** * A supplier of {@code int} values. * - *

This is the primitive type specialization of {@link Supplier} for - * {@code int} and also may be used as a {@code Supplier}. + * This is the primitive type specialization of {@link Supplier} for {@code int} + * and also may be used as a {@code Supplier}. * * @since 1.8 */ -public interface IntSupplier { +public interface IntSupplier extends Supplier { + + /** + * {@inheritDoc} + */ + @Override + public default Integer get() { + return getAsInt(); + } /** * Returns an {@code int} value. --- old/src/share/classes/java/util/function/IntUnaryOperator.java 2012-12-04 21:26:59.132643590 -0800 +++ new/src/share/classes/java/util/function/IntUnaryOperator.java 2012-12-04 21:26:58.928643581 -0800 @@ -27,9 +27,26 @@ /** * An operation on a single {@code int} operand yielding an {@code int} result. * + *

This is the primitive type specialization of {@link IntUnaryOperator} for + * {@code int} and also may be used as a {@code IntUnaryOperator}. When + * used as a {@code IntUnaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface IntUnaryOperator { +public interface IntUnaryOperator extends UnaryOperator { + + /** + * {@inheritDoc} + * + * @param operand {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Integer operate(Integer operand) { + return operateAsInt((int) operand); + } /** * Returns the {@code int} result of the operation upon the {@code int} --- old/src/share/classes/java/util/function/LongBinaryOperator.java 2012-12-04 21:26:59.796643623 -0800 +++ new/src/share/classes/java/util/function/LongBinaryOperator.java 2012-12-04 21:26:59.588643613 -0800 @@ -27,9 +27,27 @@ /** * An operation on two {@code long} operands yielding a {@code long} result. * + *

This is the primitive type specialization of {@link BinaryOperator} for + * {@code long} and also may be used as a {@code BinaryOperator}. When + * used as a {@code BinaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface LongBinaryOperator { +public interface LongBinaryOperator extends BinaryOperator { + + /** + * {@inheritDoc} + * + * @param left {@inheritDoc}, must be non-null + * @param right {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Long operate(Long left, Long right) { + return operateAsLong((long)left, (long)right); + } /** * Returns the {@code long} result of the operation upon the {@code long} --- old/src/share/classes/java/util/function/LongBlock.java 2012-12-04 21:27:00.460643655 -0800 +++ new/src/share/classes/java/util/function/LongBlock.java 2012-12-04 21:27:00.256643645 -0800 @@ -29,11 +29,23 @@ * external state. * *

This is the primitive type specialization of {@link Block} for - * {@code long} and also may be used as a {@code Block}. + * {@code long} and also may be used as a {@code Block}. When used as + * a {@code Block} the default {@code accept} implementation provided by this + * interface does not accept null parameters. * * @since 1.8 */ -public interface LongBlock { +public interface LongBlock extends Block { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + */ + @Override + public default void accept(Long t) { + accept((long)t); + } /** * Use the {@code long} input value in an operation which may modify --- old/src/share/classes/java/util/function/LongFunction.java 2012-12-04 21:27:01.132643687 -0800 +++ new/src/share/classes/java/util/function/LongFunction.java 2012-12-04 21:27:00.920643677 -0800 @@ -28,11 +28,26 @@ * Apply a function to the input object yielding an appropriate {@code long} * value; this is the {@code long}-bearing specialization for {@link Function}. * + *

When used as a {@code Function} the default {@code apply} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @param the type of input objects to the function * * @since 1.8 */ -public interface LongFunction { +public interface LongFunction extends Function { + + /** + * {@inheritDoc} + * + * @param t {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Long apply(T t) { + return applyAsLong(t); + } /** * Apply a function to the input object yielding an appropriate {@code long} --- old/src/share/classes/java/util/function/LongSupplier.java 2012-12-04 21:27:01.800643720 -0800 +++ new/src/share/classes/java/util/function/LongSupplier.java 2012-12-04 21:27:01.588643709 -0800 @@ -32,7 +32,15 @@ * * @since 1.8 */ -public interface LongSupplier { +public interface LongSupplier extends Supplier { + + /** + * {@inheritDoc} + */ + @Override + public default Long get() { + return getAsLong(); + } /** * Returns a {@code long} value. --- old/src/share/classes/java/util/function/LongUnaryOperator.java 2012-12-04 21:27:02.472643752 -0800 +++ new/src/share/classes/java/util/function/LongUnaryOperator.java 2012-12-04 21:27:02.264643742 -0800 @@ -27,9 +27,26 @@ /** * An operation on a single {@code long} operand yielding a {@code long} result. * + *

This is the primitive type specialization of {@link UnaryOperator} for + * {@code long} and also may be used as a {@code UnaryOperator}. When + * used as a {@code UnaryOperator} the default {@code operate} implementation + * provided by this interface neither accepts null parameters nor does it return + * null results. + * * @since 1.8 */ -public interface LongUnaryOperator { +public interface LongUnaryOperator extends UnaryOperator { + + /** + * {@inheritDoc} + * + * @param operand {@inheritDoc}, must be non-null + * @return {@inheritDoc}, always non-null + */ + @Override + public default Long operate(Long operand) { + return operateAsLong((long)operand); + } /** * Returns the {@code long} result of the operation upon the {@code long} --- old/src/share/classes/java/util/function/UnaryOperator.java 2012-12-04 21:27:03.136643784 -0800 +++ new/src/share/classes/java/util/function/UnaryOperator.java 2012-12-04 21:27:02.932643774 -0800 @@ -32,7 +32,12 @@ * * @since 1.8 */ -public interface UnaryOperator { +public interface UnaryOperator extends Function { + + @Override + public default T apply(T operand) { + return operate(operand); + } /** * Returns the result of the operation upon the operand.