equal
deleted
inserted
replaced
26 package java.lang.invoke; |
26 package java.lang.invoke; |
27 |
27 |
28 |
28 |
29 import java.util.*; |
29 import java.util.*; |
30 import java.lang.invoke.LambdaForm.BasicType; |
30 import java.lang.invoke.LambdaForm.BasicType; |
31 import sun.invoke.util.*; |
|
32 import sun.misc.Unsafe; |
31 import sun.misc.Unsafe; |
33 |
32 |
34 import static java.lang.invoke.MethodHandleStatics.*; |
33 import static java.lang.invoke.MethodHandleStatics.*; |
35 import static java.lang.invoke.LambdaForm.BasicType.*; |
34 import static java.lang.invoke.LambdaForm.BasicType.*; |
36 |
35 |
986 asCollectorChecks(arrayType, arrayLength); |
985 asCollectorChecks(arrayType, arrayLength); |
987 int collectArgPos = type().parameterCount()-1; |
986 int collectArgPos = type().parameterCount()-1; |
988 MethodHandle target = this; |
987 MethodHandle target = this; |
989 if (arrayType != type().parameterType(collectArgPos)) |
988 if (arrayType != type().parameterType(collectArgPos)) |
990 target = convertArguments(type().changeParameterType(collectArgPos, arrayType)); |
989 target = convertArguments(type().changeParameterType(collectArgPos, arrayType)); |
991 MethodHandle collector = ValueConversions.varargsArray(arrayType, arrayLength); |
990 MethodHandle collector = MethodHandleImpl.varargsArray(arrayType, arrayLength); |
992 return MethodHandles.collectArguments(target, collectArgPos, collector); |
991 return MethodHandles.collectArguments(target, collectArgPos, collector); |
993 } |
992 } |
994 |
993 |
995 // private API: return true if last param exactly matches arrayType |
994 // private API: return true if last param exactly matches arrayType |
996 private boolean asCollectorChecks(Class<?> arrayType, int arrayLength) { |
995 private boolean asCollectorChecks(Class<?> arrayType, int arrayLength) { |