equal
deleted
inserted
replaced
922 int collectArgPos = type().parameterCount()-1; |
922 int collectArgPos = type().parameterCount()-1; |
923 MethodHandle target = this; |
923 MethodHandle target = this; |
924 if (arrayType != type().parameterType(collectArgPos)) |
924 if (arrayType != type().parameterType(collectArgPos)) |
925 target = convertArguments(type().changeParameterType(collectArgPos, arrayType)); |
925 target = convertArguments(type().changeParameterType(collectArgPos, arrayType)); |
926 MethodHandle collector = ValueConversions.varargsArray(arrayType, arrayLength); |
926 MethodHandle collector = ValueConversions.varargsArray(arrayType, arrayLength); |
927 return MethodHandleImpl.makeCollectArguments(target, collector, collectArgPos, false); |
927 return MethodHandles.collectArguments(target, collectArgPos, collector); |
928 } |
928 } |
929 |
929 |
930 // private API: return true if last param exactly matches arrayType |
930 // private API: return true if last param exactly matches arrayType |
931 private boolean asCollectorChecks(Class<?> arrayType, int arrayLength) { |
931 private boolean asCollectorChecks(Class<?> arrayType, int arrayLength) { |
932 spreadArrayChecks(arrayType, arrayLength); |
932 spreadArrayChecks(arrayType, arrayLength); |
1224 } |
1224 } |
1225 String standardString() { |
1225 String standardString() { |
1226 return "MethodHandle"+type; |
1226 return "MethodHandle"+type; |
1227 } |
1227 } |
1228 String debugString() { |
1228 String debugString() { |
1229 return standardString()+"="+internalForm()+internalValues(); |
1229 return standardString()+"/LF="+internalForm()+internalProperties(); |
1230 } |
1230 } |
1231 |
1231 |
1232 //// Implementation methods. |
1232 //// Implementation methods. |
1233 //// Sub-classes can override these default implementations. |
1233 //// Sub-classes can override these default implementations. |
1234 //// All these methods assume arguments are already validated. |
1234 //// All these methods assume arguments are already validated. |
1267 return null; // DMH returns DMH.member |
1267 return null; // DMH returns DMH.member |
1268 } |
1268 } |
1269 |
1269 |
1270 /*non-public*/ |
1270 /*non-public*/ |
1271 Object internalValues() { |
1271 Object internalValues() { |
|
1272 return null; |
|
1273 } |
|
1274 |
|
1275 /*non-public*/ |
|
1276 Object internalProperties() { |
|
1277 // Override to something like "/FOO=bar" |
1272 return ""; |
1278 return ""; |
1273 } |
1279 } |
1274 |
1280 |
1275 //// Method handle implementation methods. |
1281 //// Method handle implementation methods. |
1276 //// Sub-classes can override these default implementations. |
1282 //// Sub-classes can override these default implementations. |