changeset 6425:9362e6b9866a

More renames and primitive specializations. sync with proposed TL patch
author mduigou
date Fri, 16 Nov 2012 18:03:01 -0800
parents ba27872c81f8
children c79261933eb2
files src/share/classes/java/util/function/BiBlock.java src/share/classes/java/util/function/BiFunction.java src/share/classes/java/util/function/BinaryOperator.java src/share/classes/java/util/function/Block.java src/share/classes/java/util/function/Combiner.java src/share/classes/java/util/function/DoubleBinaryOperator.java src/share/classes/java/util/function/DoubleBlock.java src/share/classes/java/util/function/DoubleFunction.java src/share/classes/java/util/function/DoubleSupplier.java src/share/classes/java/util/function/DoubleUnaryOperator.java src/share/classes/java/util/function/FlatMapper.java src/share/classes/java/util/function/Function.java src/share/classes/java/util/function/Functions.java src/share/classes/java/util/function/IntBinaryOperator.java src/share/classes/java/util/function/IntBlock.java src/share/classes/java/util/function/IntFunction.java src/share/classes/java/util/function/IntSupplier.java src/share/classes/java/util/function/IntUnaryOperator.java src/share/classes/java/util/function/LongBinaryOperator.java src/share/classes/java/util/function/LongBlock.java src/share/classes/java/util/function/LongFunction.java src/share/classes/java/util/function/LongSupplier.java src/share/classes/java/util/function/LongUnaryOperator.java src/share/classes/java/util/function/Predicate.java src/share/classes/java/util/function/Supplier.java src/share/classes/java/util/function/UnaryOperator.java src/share/classes/java/util/function/package-info.java src/share/classes/java/util/function/package.html src/share/classes/java/util/stream/primitive/Primitives.java test-ng/tests/org/openjdk/tests/java/lang/PrimitiveSumMinMaxTest.java test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java
diffstat 31 files changed, 615 insertions(+), 403 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/function/BiBlock.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/BiBlock.java	Fri Nov 16 18:03:01 2012 -0800
@@ -25,11 +25,6 @@
 package java.util.function;
 
 /**
- * BiBlock
- *
- * @author Brian Goetz
- */
-/**
  * Performs operations upon an input object which may modify that object and/or
  * external state (other objects).
  *
--- a/src/share/classes/java/util/function/BiFunction.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/BiFunction.java	Fri Nov 16 18:03:01 2012 -0800
@@ -25,30 +25,30 @@
 package java.util.function;
 
 /**
- * Given input objects maps to an appropriate output object. A mapper may
+ * Given input objects maps to an appropriate output object. A function may
  * variously provide a mapping between types, object instances or keys and
  * values or any other form of transformation upon the input.
  *
- * <p/>All mapper implementations are expected to:
+ * <p/>All function implementations are expected to:
  * <ul>
  *  <li>Provide stable results such that for any {@code t} the result of two
  * {@code map} operations are always equivalent. ie.<pre>
- * Foo one = mapper.map(a);
- * Foo two = mapper.map(a);
+ * Foo one = function.map(a);
+ * Foo two = function.map(a);
  *
  * assert one.equals(two) && two.equals(one);
  * </pre></li>
  * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
  * assert a.equals(b);  // a and b are equivalent
  *
- * Foo x = mapper.map(a);
- * Foo y = mapper.map(b);
+ * Foo x = function.apply(a);
+ * Foo y = function.apply(b);
  *
- * assert x.equals(y); // their mapped results should be as equivalent.
+ * assert x.equals(y); // the function results should be as equivalent.
  * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
+ * <li>The function should not modify the input object in any way that would
  * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
+ * <li>When used for aggregate operations upon many elements functions
  * should not assume that the {@code map} operation will be called upon elements
  * in any specific order.</li>
  * </ul>
@@ -69,18 +69,18 @@
      */
     R map(T t, U u);
 
-    /**
-     * Combine with another function producing a function which preforms both
-     * operations.
-     *
-     * @param <W> Type of output objects from the combined function. May be the
-     * same type as {@code <U>}.
-     * @param after An additional function to be applied to the result of this
-     * function.
-     * @return A function which performs both the original function followed by
-     * a second function.
-     */
-    public default <W> BiFunction<W, T, U> compose(Function<? extends W, ? super R> after) {
-        throw new UnsupportedOperationException("Not yet implemented.");
-    }
+//    /**
+//     * Combine with another function producing a function which preforms both
+//     * operations.
+//     *
+//     * @param <W> Type of output objects from the combined function. May be the
+//     * same type as {@code <U>}.
+//     * @param after An additional function to be applied to the result of this
+//     * function.
+//     * @return A function which performs both the original function followed by
+//     * a second function.
+//     */
+//    public default <W> BiFunction<W, T, U> compose(BiFunction<? extends W, ? extends W, ? super R> after) {
+//        throw new UnsupportedOperationException("Not yet implemented.");
+//    }
 }
--- a/src/share/classes/java/util/function/BinaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/BinaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,40 +25,27 @@
 package java.util.function;
 
 /**
- * Combines two operands.
+ * Combines two operands of the same type producing a result of the same type.
  *
- * <p>All Operator implementations are expected to:
- * <ul>
- * <li>Provide stable
- * results such that for any {@code a} and {@code b} the result of two {@code eval}
- * operations are always equivalent. ie.<pre>
- * Foo one = operator.eval(a,b);
- * Foo two = operator.eval(a,b);
+ * @param <T> the type of input objects to {@code operate} and of the result.
  *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- *
- * <li>The operator should not modify the input object in any way
- * that would change the result.</li>
- *
- * <li>When used for aggregate operations
- * upon many elements operators should not assume that the {@code eval}
- * operation will be called upon elements in any specific order ie.<pre>
- * Foo one = operator.eval(a,operator.eval(b,c));
- * Foo two = operator.eval(b,operator.eval(a,c));
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- * </ul>
- *
- * @param <T> the type of input objects provided to {@code eval} and the result.
+ * @since 1.8
  */
-public interface BinaryOperator<T> extends Combiner<T, T, T> {
-
-    public T operate(T left, T right);
+public interface BinaryOperator<T> extends Combiner<T,T,T> {
 
     @Override
     public default T combine(T t1, T t2) {
         return operate(t1, t2);
     }
+    
+    /**
+     * Returns the result of some binary operation upon the provided operands.
+     * The operands are named {@code left} and {@code right} for operations
+     * where the order of operands matters.
+     *
+     * @param left input object used as the left operand
+     * @param right input object used as the right operand
+     * @return result of the operation
+     */
+    public T operate(T left, T right);
 }
--- a/src/share/classes/java/util/function/Block.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Block.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,17 +1,36 @@
+/*
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
 package java.util.function;
 
 /**
  * Performs operations upon an input object which may modify that object and/or
  * external state (other objects).
  *
- * <p>All block implementations are expected to:
- * <ul>
- * <li>When used for aggregate operations upon many elements blocks
- * should not assume that the {@code apply} operation will be called upon
- * elements in any specific order.</li>
- * </ul>
+ * @param <T> The type of input objects to {@code accept}.
  *
- * @param <T> The type of input objects to {@code apply}.
+ * @since 1.8
  */
 public interface Block<T> {
 
@@ -19,9 +38,9 @@
      * Performs operations upon the provided object which may modify that object
      * and/or external state.
      *
-     * @param t an input object
+     * @param t the input object
      */
-    void apply(T t);
+    public void apply(T t);
 
     /**
      * Returns a Block which performs in sequence the {@code apply} methods of
--- a/src/share/classes/java/util/function/Combiner.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Combiner.java	Fri Nov 16 18:03:01 2012 -0800
@@ -25,9 +25,11 @@
 package java.util.function;
 
 /**
- * Combiner
+ * Combine two operands to produce a result.
  *
- * @author Brian Goetz
+ * @param <T> Type of first operand
+ * @param <U> Type of second operand
+ * @param <R> Type of result.
  */
 public interface Combiner<R, T, U> {
     R combine(T t, U u);
--- a/src/share/classes/java/util/function/DoubleBinaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/DoubleBinaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,31 @@
 package java.util.function;
 
 /**
- * DoubleBiOperator
+ * Combines two {@code double} operands producing an {@code double} result.
+ *
+ * @since 1.8
  */
-public interface DoubleBinaryOperator {
-    public double eval(double left, double right);
+public interface DoubleBinaryOperator extends BinaryOperator<Double> {
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters 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
+     * @return result of the operation
+     */
+    public default Double operate(Double left, Double right) { return operate((double) left, (double) right); }
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters are named {@code left} and {@code right} for operations where
+     * the order of operands matters.
+     *
+     * @param left value used as the left operand
+     * @param rightvalue used as the right operand
+     * @return result value of the operation
+     */
+    public double operate(double left, double right);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/DoubleBlock.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Performs operations upon an input object which may modify that object and/or
+ * external state (other objects).
+ *
+ * @param <T> The type of input objects to {@code accept}.
+ *
+ * @since 1.8
+ */
+public interface DoubleBlock extends Block<Double> {
+
+    /**
+     * Performs operations upon the provided {@code Double} which may modify
+     * external state.
+     *
+     * @param t the input
+     */
+    @Override
+    public default void apply(Double t) { apply((double) t); }
+
+    /**
+     * Performs operations upon the provided object which may modify that object
+     * and/or external state.
+     *
+     * @param t the input value
+     */
+    public void apply(double t);
+}
--- a/src/share/classes/java/util/function/DoubleFunction.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/DoubleFunction.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,32 @@
 package java.util.function;
 
 /**
- * Given an input object maps to an appropriate double value; this is the
- * double-bearing specialization for {@link java.util.function.Mapper}.
+ * Apply a function to the input object yielding an appropriate {@code double}
+ * value; this is the {@code double}-bearing specialization for
+ * {@link Function}.
  *
- * <p/>Like Mapper, DoubleFunction implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code apply} operations are always equivalent. ie.<pre>
- * double one = mapper.apply(a);
- * double two = mapper.apply(a);
+ * @param <T> the type of input objects to the {@code apply} operation.
  *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * double x = mapper.apply(a);
- * double y = mapper.apply(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code apply} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code apply} operation.
+ * @since 1.8
  */
-public interface DoubleFunction<T> {
+public interface DoubleFunction<T> extends Function<Double,T> {
 
     /**
-     * Map the provided input object to an appropriate output object.
+     * Apply a function to the input object yielding an appropriate
+     * {@code Double}.
      *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
+     * @param t the input object to the function
+     * @return the function output {@code Double}
      */
-    double apply(T t);
+    @Override
+    public default Double apply(T t) { return applyAsDouble(t); }
+
+    /**
+     * Apply a function to the input object yielding an appropriate
+     * {@code double} value.
+     *
+     * @param t the input object to the function
+     * @return the function output value
+     */
+    public double applyAsDouble(T t);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/DoubleSupplier.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Supplies a {@code double} value or {@code Double}.
+ *
+ * @since 1.8
+ */
+public interface DoubleSupplier extends Supplier<Double> {
+
+    /**
+     * Returns a {@code Double}.
+     *
+     * @return the {@code Double}
+     */
+    @Override
+    public default Double get() { return getAsDouble(); }
+
+    /**
+     * Returns a {@code double} value.
+     *
+     * @return the value
+     */
+    public double getAsDouble();
+}
--- a/src/share/classes/java/util/function/DoubleUnaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/DoubleUnaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -27,34 +27,24 @@
 /**
  * Operator on a single {@code double} operand.
  *
- * <p>All Operator implementations are expected to:
- * <ul>
- * <li>Provide stable
- * results such that for any {@code a} the result of two {@code operate}
- * operations are always equivalent. i.e.<pre>
- * Foo one = operator.operate(a);
- * Foo two = operator.operate(a);
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- *
- * <li>The operator should not modify the input object in any way
- * that would change the result.</li>
- *
- * </ul>
- *
- * @author Jim Gish
  * @since 1.8
- *
  */
-public interface DoubleUnaryOperator {
+public interface DoubleUnaryOperator extends UnaryOperator<Double> {
 
     /**
-     * The implementation of the method is used to compute a new value
-     * from the old value.
+     * Returns a {@code Double} computed from the {@code double} operand.
      *
-     * @param operand the old value
-     * @return the new value
+     * @param operand the operand
+     * @return the computed result
+     */
+    @Override
+    public default Double operate(Double operand) { return operate((double) operand); }
+
+    /**
+     * Returns a {@code double} value computed from the {@code double} operand.
+     *
+     * @param operand the operand value
+     * @return the computed result
      */
     public double operate(double operand);
 }
--- a/src/share/classes/java/util/function/FlatMapper.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/FlatMapper.java	Fri Nov 16 18:03:01 2012 -0800
@@ -27,7 +27,6 @@
 /**
  * Map an element to zero or more results and add all results to a sink.
  *
- * @author Brian Goetz
  */
 public interface FlatMapper<R, T> {
     /**
--- a/src/share/classes/java/util/function/Function.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Function.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,47 +25,25 @@
 package java.util.function;
 
 /**
- * Given an input object maps to an appropriate output object. A mapper may
- * variously provide a mapping between types, object instances or keys and
- * values or any other form of transformation upon the input.
+ * Apply a function to the input object yielding an appropriate output object. A
+ * function may variously provide a mapping between types, object instances or
+ * keys and values or any other form of transformation upon the input.
  *
- * <p/>All mapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code apply} operations are always equivalent. ie.<pre>
- * Foo one = mapper.apply(a);
- * Foo two = mapper.apply(a);
+ * @param <T> the type of input objects provided to the {@code apply} operation.
+ * @param <R> the type of output objects from {@code apply} operation. May be
+ * the same type as {@code <T>}.
  *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * Foo x = mapper.apply(a);
- * Foo y = mapper.apply(b);
- *
- * assert x.equals(y); // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code apply} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <R> the type of output objects from {@code apply} operation. May be the
- * @param <T> the type of input objects provided to the {@code apply} operation.
- * same type as {@code <T>}.
+ * @since 1.8
  */
 public interface Function<R, T> {
 
     /**
-     * Map the provided input object to an appropriate output object.
+     * Yield an appropriate output object for the provided input object.
      *
-     * @param t the input object to be mapped.
-     * @return the mapped output object.
+     * @param t the input object to be to which the function will be applied.
+     * @return the function output object
      */
-    R apply(T t);
+    public R apply(T t);
 
     /**
      * Combine with another mapper producing a mapper which preforms both
--- a/src/share/classes/java/util/function/Functions.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Functions.java	Fri Nov 16 18:03:01 2012 -0800
@@ -32,7 +32,7 @@
 /**
  * Static utility methods pertaining to {@code Mapper} instances.
  *
- * <p>All of the returned mappers are serializable if provided serializable
+ * <p>All of the returned functions are serializable if provided serializable
  * parameters.
  */
 public final class Functions {
--- a/src/share/classes/java/util/function/IntBinaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/IntBinaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,32 @@
 package java.util.function;
 
 /**
- * IntBinaryOperator
+ * Combines two {@code int} operands producing an {@code int} result.
+ *
+ * @since 1.8
  */
-public interface IntBinaryOperator {
-    public int eval(int left, int right);
+public interface IntBinaryOperator extends BinaryOperator<Integer> {
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters are named {@code left} and {@code right} for operations where
+     * the order of parameters matters.
+     *
+     * @param left the left operand
+     * @param right the right operand
+     * @return result of the operation
+     */
+    @Override
+    public default Integer operate(Integer left, Integer right) { return operate((int) left, (int) right); }
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters are named {@code left} and {@code right} for operations where
+     * the order of parameters matters.
+     *
+     * @param left value used as the left operand
+     * @param right value used as the right operand
+     * @return result value of the operation
+     */
+    public int operate(int left, int right);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/IntBlock.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Performs operations upon an input object which may modify that object and/or
+ * external state (other objects).
+ *
+ * @param <T> The type of input objects to {@code accept}.
+ *
+ * @since 1.8
+ */
+public interface IntBlock extends Block<Integer> {
+
+    /**
+     * Performs operations upon the provided {@code Integer} which may modify
+     * external state.
+     *
+     * @param t the input
+     */
+    @Override
+    public default void apply(Integer t) { apply((int) t); }
+
+    /**
+     * Performs operations upon the provided object which may modify that object
+     * and/or external state.
+     *
+     * @param t the input value
+     */
+    public void apply(int t);
+}
--- a/src/share/classes/java/util/function/IntFunction.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/IntFunction.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,31 @@
 package java.util.function;
 
 /**
- * Given an input object maps to an appropriate integer value; this is the
- * int-bearing specialization for {@link Mapper}.
+ * Apply a function to the input object yielding an appropriate {@code int}
+ * value; this is the {@code int}-bearing specialization for {@link Function}.
  *
- * <p/>Like Mapper, IntFunction implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code apply} operations are always equivalent. ie.<pre>
- * int one = mapper.apply(a);
- * int two = mapper.apply(a);
+ * @param <T> the type of input objects to the {@code apply} operation.
  *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * int x = mapper.apply(a);
- * int y = mapper.apply(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code apply} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code apply} operation.
+ * @since 1.8
  */
-public interface IntFunction<T> {
+public interface IntFunction<T> extends Function<Integer,T> {
 
     /**
-     * Map the provided input object to an appropriate output object.
+     * Apply a function to the input object yielding an appropriate
+     * {@code Integer}.
      *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
+     * @param t the input object to the function
+     * @return the function output {@code Integer}
      */
-    int apply(T t);
+    @Override
+    public default Integer apply(T t) { return applyAsInt(t); }
+
+    /**
+     * Apply a function to the input object yielding an appropriate {@code int}
+     * value.
+     *
+     * @param t the input object to the function
+     * @return the function output value
+     */
+    public int applyAsInt(T t);
 }
--- a/src/share/classes/java/util/function/IntSupplier.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/IntSupplier.java	Fri Nov 16 18:03:01 2012 -0800
@@ -24,17 +24,25 @@
  */
 package java.util.function;
 
-import java.util.function.Supplier;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
+/**
+ * Supplies a {@code int} value or {@code Integer}.
+ *
+ * @since 1.8
+ */
 public interface IntSupplier extends Supplier<Integer> {
 
+    /**
+     * Returns an {@code Integer}.
+     *
+     * @return the {@code Integer}.
+     */
     @Override
-    default Integer get() {
-        Logger.getLogger(getClass().getName()).log(Level.WARNING, "{0} using boxed int", getClass().getName());
-        return getInt();
-    }
+    public default Integer get() { return getAsInt(); }
 
-    int getInt();
+    /**
+     * Returns an {@code int} value.
+     *
+     * @return the value
+     */
+    public int getAsInt();
 }
--- a/src/share/classes/java/util/function/IntUnaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/IntUnaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -27,34 +27,24 @@
 /**
  * Operator on a single {@code int} operand.
  *
- * <p>All Operator implementations are expected to:
- * <ul>
- * <li>Provide stable
- * results such that for any {@code a} the result of two {@code operate}
- * operations are always equivalent. i.e.<pre>
- * Foo one = operator.operate(a);
- * Foo two = operator.operate(a);
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- *
- * <li>The operator should not modify the input object in any way
- * that would change the result.</li>
- *
- * </ul>
- *
- * @author Jim Gish
  * @since 1.8
- *
  */
-public interface IntUnaryOperator {
+public interface IntUnaryOperator extends UnaryOperator<Integer> {
 
     /**
-     * The implementation of the method is used to compute a new value
-     * from the old value.
+     * Returns an {@code Integer} computed from the {@code Integer} operand.
      *
-     * @param operand the old value
-     * @return the new value
+     * @param operand the operand value
+     * @return the computed result
+     */
+    @Override
+    public default Integer operate(Integer operand) { return operate((int) operand); }
+
+    /**
+     * Returns an {@code int} value computed from the {@code int} operand.
+     *
+     * @param operand the operand value
+     * @return the computed result
      */
     public int operate(int operand);
 }
--- a/src/share/classes/java/util/function/LongBinaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/LongBinaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,32 @@
 package java.util.function;
 
 /**
- * LongBinaryOperator
+ * Combines two {@code long} operands producing an {@code long} result.
+ *
+ * @since 1.8
  */
-public interface LongBinaryOperator {
-    public long eval(long left, long right);
+public interface LongBinaryOperator extends BinaryOperator<Long> {
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters 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
+     * @return result of the operation
+     */
+    @Override
+    public default Long operate(Long left, Long right) { return operate((long) left, (long) right); }
+
+    /**
+     * Returns the result of some binary operation upon the operands. The
+     * parameters are named {@code left} and {@code right} for operations where
+     * the order of operands matters.
+     *
+     * @param left value used as the left operand
+     * @param right value used as the right operand
+     * @return result value of the operation
+     */
+    public long operate(long left, long right);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/LongBlock.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Performs operations upon an input object which may modify that object and/or
+ * external state (other objects).
+ *
+ * @param <T> The type of input objects to {@code accept}.
+ *
+ * @since 1.8
+ */
+public interface LongBlock extends Block<Long> {
+
+    /**
+     * Performs operations upon the provided {@code Long} which may modify
+     * external state.
+     *
+     * @param t the input
+     */
+    @Override
+    public default void apply(Long t) { apply((long) t); }
+
+    /**
+     * Performs operations upon the provided object which may modify that object
+     * and/or external state.
+     *
+     * @param t the input value
+     */
+    public void apply(long t);
+}
--- a/src/share/classes/java/util/function/LongFunction.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/LongFunction.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,31 @@
 package java.util.function;
 
 /**
- * Given an input object maps to an appropriate long value; this is the
- * long-bearing specialization for {@link java.util.function.Mapper}.
+ * Apply a function to the input object yielding an appropriate {@code long}
+ * value; this is the {@code long}-bearing specialization for {@link Function}.
  *
- * <p/>Like Mapper, LongFunction implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code apply} operations are always equivalent. ie.<pre>
- * long one = mapper.apply(a);
- * long two = mapper.apply(a);
+ * @param <T> the type of input objects to the {@code apply} operation.
  *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * long x = mapper.apply(a);
- * long y = mapper.apply(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code apply} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code apply} operation.
+ * @since 1.8
  */
-public interface LongFunction<T> {
+public interface LongFunction<T> extends Function<Long,T> {
 
     /**
-     * Map the provided input object to an appropriate output object.
+     * Apply a function to the input object yielding an appropriate
+     * {@code Long}.
      *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
+     * @param t the input object to the function
+     * @return the function output {@code Long}
      */
-    long apply(T t);
+    @Override
+    public default Long apply(T t) { return applyAsLong(t); }
+
+    /**
+     * Apply a function to the input object yielding an appropriate {@code long}
+     * value.
+     *
+     * @param t the input object to the function
+     * @return the function output value
+     */
+    public long applyAsLong(T t);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/LongSupplier.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Supplies a {@code long} value or {@code Long}.
+ *
+ * @since 1.8
+ */
+public interface LongSupplier extends Supplier<Long> {
+    /**
+     * Returns a {@code Long} value.
+     *
+     * @return the value
+     */
+    @Override
+    public default Long get() { return getAsLong(); }
+
+    /**
+     * Returns a {@code long} value.
+     *
+     * @return the value
+     */
+    public long getAsLong();
+}
--- a/src/share/classes/java/util/function/LongUnaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/LongUnaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -27,34 +27,24 @@
 /**
  * Operator on a single {@code long} operand.
  *
- * <p>All Operator implementations are expected to:
- * <ul>
- * <li>Provide stable
- * results such that for any {@code a} the result of two {@code operate}
- * operations are always equivalent. i.e.<pre>
- * Foo one = operator.operate(a);
- * Foo two = operator.operate(a);
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- *
- * <li>The operator should not modify the input object in any way
- * that would change the result.</li>
- *
- * </ul>
- *
- * @author Jim Gish
  * @since 1.8
- *
  */
-public interface LongUnaryOperator {
+public interface LongUnaryOperator extends UnaryOperator<Long> {
 
     /**
-     * The implementation of the method is used to compute a new value
-     * from the old value.
+     * Returns a {@code Long} computed from the {@code Long} operand.
      *
-     * @param operand the old value
-     * @return the new value
+     * @param operand the operand value
+     * @return the computed result
+     */
+    @Override
+    public default Long operate(Long operand) { return operate((long) operand); }
+
+    /**
+     * Returns a {@code long} value computed from the {@code long} operand.
+     *
+     * @param operand the operand value
+     * @return the computed result
      */
     public long operate(long operand);
 }
--- a/src/share/classes/java/util/function/Predicate.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Predicate.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,47 +22,25 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package java.util.function;
 
 /**
  * Determines if the input object matches some criteria.
  *
- * <p>All predicate implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code eval} operations are always equivalent. ie.<pre>
- * boolean one = predicate.test(a);
- * boolean two = predicate.test(a);
+ * @param <T> the type of input objects provided to {@code test}.
  *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * boolean x = predicate.test(a);
- * boolean y = predicate.test(ab;
- *
- * assert x == y; // their test results should be the same.
- * </pre></li>
- * <li>The predicate should not modify the input object in any way that would
- * change the evaluation.</li>
- * <li>When used for aggregate operations upon many elements predicates
- * should not assume that the {@code test} operation will be called upon
- * elements in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to {@code test}.
+ * @since 1.8
  */
 public interface Predicate<T> {
 
     /**
      * Return {@code true} if the input object matches some criteria.
      *
-     * @param t the input object.
-     * @return {@code true} if the input object matched some criteria.
+     * @param t the input object
+     * @return {@code true} if the input object matched some criteria otherwise
+     * {@code false}
      */
-     boolean test(T t);
+    public boolean test(T t);
 
     /**
      * Create a predicate which evaluates to {@code true} only if this predicate
@@ -73,7 +51,7 @@
      * @return a new predicate which returns {@code true} only if both
      * predicates return {@code true}.
      */
-    default Predicate<T> and(Predicate<? super T> p) {
+    public default Predicate<T> and(Predicate<? super T> p) {
         return Predicates.and(this, p);
     }
 
@@ -82,7 +60,7 @@
      *
      * @return a new predicate who's result is always the opposite of this predicate.
      */
-    default Predicate<T> negate() {
+    public default Predicate<T> negate() {
         return Predicates.negate(this);
     }
 
@@ -95,7 +73,7 @@
      * @return a new predicate which returns {@code true} if either predicate
      * returns {@code true}.
      */
-    default Predicate<T> or(Predicate<? super T> p) {
+    public default Predicate<T> or(Predicate<? super T> p) {
         return Predicates.or(this, p);
     }
 
@@ -108,7 +86,7 @@
      * @return  a predicate that evaluates to {@code true} if all or none of the
      * component predicates evaluate to {@code true}
      */
-    default Predicate<T> xor(Predicate<? super T> p) {
+    public default Predicate<T> xor(Predicate<? super T> p) {
         return Predicates.xor(this, p);
     }
 }
--- a/src/share/classes/java/util/function/Supplier.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/Supplier.java	Fri Nov 16 18:03:01 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,19 @@
 package java.util.function;
 
 /**
- * aka Source and Producer
+ * Returns an object, either created during the invocation of {@code get} or by
+ * some prior action.
  *
- * <p>All Supplier implementations are expected to:
- * <ul>
- * <li></li>
- * </ul>
+ * @param <T> The type of objects returned by {@code get}.
  *
- * @param <T> The type of objects returned by {@code create}.
+ * @since 1.8
  */
 public interface Supplier<T> {
 
     /**
      * Returns an object.
      *
-     * @return an object.
+     * @return an object
      */
-    T get();
-
+    public T get();
 }
--- a/src/share/classes/java/util/function/UnaryOperator.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/function/UnaryOperator.java	Fri Nov 16 18:03:01 2012 -0800
@@ -27,36 +27,19 @@
 /**
  * Operator on a single operand.
  *
- * <p>All Operator implementations are expected to:
- * <ul>
- * <li>Provide stable
- * results such that for any {@code a} the result of two {@code operate}
- * operations are always equivalent. i.e.<pre>
- * Foo one = operator.operate(a);
- * Foo two = operator.operate(a);
+ * @param <T> the type of input objects to {@code operate} and of the result.
  *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- *
- * <li>The operator should not modify the input object in any way
- * that would change the result.</li>
- *
- * </ul>
- *
- * @param <T> the type of input objects provided to {@code operate} and the result.
- *
- * @author Jim Gish
  * @since 1.8
- *
  */
-public interface UnaryOperator<T> {
+public interface UnaryOperator<T> extends Function<T,T> {
+    @Override
+    public default T apply(T operand) { return operate(operand); }
 
     /**
-     * The implementation of the method is used to compute a new value
-     * from the old value.
+     * Returns a result computed from the provided operand.
      *
-     * @param operand the old value
-     * @return the new value
+     * @param operand the operand
+     * @return the computed result
      */
     public T operate(T operand);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/package-info.java	Fri Nov 16 18:03:01 2012 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/**
+ * <em>Functional interfaces</em> provide typing for lambda expressions. Each
+ * functional interface provides a single abstract method to which the lambda
+ * expression's parameter and return types are matched.
+ *
+ * <p>The interfaces in this package are all functional interfaces used with the
+ * collections and streams frameworks. The operation identified by each
+ * interface is generally applied to a collection or stream of objects.
+ *
+ * <p>All functional interface implementations are expected to:
+ * <ul>
+ * <li>When used for aggregate operations upon many elements it should not be
+ * assumed that the operation will be called upon elements in any specific order.
+ * </li>
+ * </ul>
+ */
+package java.util.function;
--- a/src/share/classes/java/util/function/package.html	Fri Nov 16 17:03:41 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-These interfaces each provide a single accessible method and are used to
-provide typing for lambda methods. The operation identified by each interface
-is generally applied to a collection of objects.
-
-<p>
-
-</body>
-</html>
--- a/src/share/classes/java/util/stream/primitive/Primitives.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/src/share/classes/java/util/stream/primitive/Primitives.java	Fri Nov 16 18:03:01 2012 -0800
@@ -307,7 +307,7 @@
         Objects.requireNonNull(f);
 
         if (n < 0) {
-            IntInfiniteIterator iterator = () -> f.getInt();
+            IntInfiniteIterator iterator = () -> f.getAsInt();
             return stream(iterator, StreamOpFlags.IS_ORDERED);
         }
         else {
@@ -326,7 +326,7 @@
                     }
 
                     c--;
-                    return f.getInt();
+                    return f.getAsInt();
                 }
             };
 
--- a/test-ng/tests/org/openjdk/tests/java/lang/PrimitiveSumMinMaxTest.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/lang/PrimitiveSumMinMaxTest.java	Fri Nov 16 18:03:01 2012 -0800
@@ -52,11 +52,11 @@
         for (int i : numbers) {
             for (int j : numbers) {
                 assertEquals(i+j, (int) sum1.operate(i, j));
-                assertEquals(i+j, sum2.eval(i, j));
+                assertEquals(i+j, sum2.operate(i, j));
                 assertEquals(Math.max(i,j), (int) max1.operate(i, j));
-                assertEquals(Math.max(i,j), max2.eval(i, j));
+                assertEquals(Math.max(i,j), max2.operate(i, j));
                 assertEquals(Math.min(i,j), (int) min1.operate(i, j));
-                assertEquals(Math.min(i,j), min2.eval(i, j));
+                assertEquals(Math.min(i,j), min2.operate(i, j));
                 assertEquals(((Integer) i).compareTo(j), cmp.compare(i, j));
             }
         }
--- a/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Fri Nov 16 17:03:41 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Fri Nov 16 18:03:01 2012 -0800
@@ -93,7 +93,7 @@
             things[i] = new Thing(intValues[i], 0L, 0.0, null);
         Comparator<Thing> comp = Comparators.comparing(new IntFunction<Thing>() {
             @Override
-            public int apply(Thing thing) {
+            public int applyAsInt(Thing thing) {
                 return thing.getIntField();
             }
         });
@@ -107,7 +107,7 @@
             things[i] = new Thing(0, longValues[i], 0.0, null);
         Comparator<Thing> comp = Comparators.comparing(new LongFunction<Thing>() {
             @Override
-            public long apply(Thing thing) {
+            public long applyAsLong(Thing thing) {
                 return thing.getLongField();
             }
         });
@@ -121,7 +121,7 @@
             things[i] = new Thing(0, 0L, doubleValues[i], null);
         Comparator<Thing> comp = Comparators.comparing(new DoubleFunction<Thing>() {
             @Override
-            public double apply(Thing thing) {
+            public double applyAsDouble(Thing thing) {
                 return thing.getDoubleField();
             }
         });