jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
changeset 29094 a4fd2b5e49f8
parent 29020 9f6d43586ccb
child 31671 362e0c0acece
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Wed Jul 05 20:21:13 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Fri Feb 20 18:32:10 2015 +0300
@@ -453,10 +453,8 @@
      */
     // @param type type (permanently assigned) of the new method handle
     /*non-public*/ MethodHandle(MethodType type, LambdaForm form) {
-        type.getClass();  // explicit NPE
-        form.getClass();  // explicit NPE
-        this.type = type;
-        this.form = form.uncustomize();
+        this.type = Objects.requireNonNull(type);
+        this.form = Objects.requireNonNull(form).uncustomize();
 
         this.form.prepare();  // TO DO:  Try to delay this step until just before invocation.
     }
@@ -1171,7 +1169,7 @@
      * @see #asFixedArity
      */
     public MethodHandle asVarargsCollector(Class<?> arrayType) {
-        arrayType.getClass(); // explicit NPE
+        Objects.requireNonNull(arrayType);
         boolean lastMatch = asCollectorChecks(arrayType, 0);
         if (isVarargsCollector() && lastMatch)
             return this;