equal
deleted
inserted
replaced
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); |