--- old/src/share/classes/java/lang/Short.java 2012-12-10 15:42:27.910997955 -0800 +++ new/src/share/classes/java/lang/Short.java 2012-12-10 15:42:27.738997948 -0800 @@ -531,6 +531,45 @@ return ((long) x) & 0xffffL; } + /** + * Adds two {@code short} values together as per the + operator. + * + * @param a the first operand + * @param b the second operand + * @return the sum of {@code a} and {@code b} + * @see java.util.function.BinaryOperator + * @since 1.8 + */ + public static short sum(short a, short b) { + return (short) (a + b); + } + + /** + * Returns the greater of two {@code short} values. + * + * @param a the first operand + * @param b the second operand + * @return the larger of {@code a} and {@code b} + * @see java.util.function.BinaryOperator + * @since 1.8 + */ + public static short max(short a, short b) { + return (a >= b) ? a : b; + } + + /** + * Returns the lesser of two {@code short} values. + * + * @param a the first operand + * @param b the second operand + * @return the lesser of {@code a} and {@code b} + * @see java.util.function.BinaryOperator + * @since 1.8 + */ + public static short min(short a, short b) { + return (a <= b) ? a : b; + } + /** use serialVersionUID from JDK 1.1. for interoperability */ private static final long serialVersionUID = 7515723908773894738L; }