src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
changeset 47856 76519338df34
parent 47825 13e39ca700d0
child 49240 5290e816c64c
equal deleted inserted replaced
47855:72b6d674bde2 47856:76519338df34
   660         LambdaForm form = new LambdaForm(lambdaType.parameterCount(), names, Kind.SPREAD);
   660         LambdaForm form = new LambdaForm(lambdaType.parameterCount(), names, Kind.SPREAD);
   661         return SimpleMethodHandle.make(srcType, form);
   661         return SimpleMethodHandle.make(srcType, form);
   662     }
   662     }
   663 
   663 
   664     static void checkSpreadArgument(Object av, int n) {
   664     static void checkSpreadArgument(Object av, int n) {
   665         if (av == null) {
   665         if (av == null && n == 0) {
   666             if (n == 0)  return;
   666             return;
       
   667         } else if (av == null) {
       
   668             throw new NullPointerException("null array reference");
   667         } else if (av instanceof Object[]) {
   669         } else if (av instanceof Object[]) {
   668             int len = ((Object[])av).length;
   670             int len = ((Object[])av).length;
   669             if (len == n)  return;
   671             if (len == n)  return;
   670         } else {
   672         } else {
   671             int len = java.lang.reflect.Array.getLength(av);
   673             int len = java.lang.reflect.Array.getLength(av);