src/share/classes/java/lang/invoke/MethodHandle.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/classes/java/lang/invoke/MethodHandle.java Wed Jul 16 20:33:23 2014
--- new/src/share/classes/java/lang/invoke/MethodHandle.java Wed Jul 16 20:33:23 2014
*** 761,771 ****
--- 761,771 ----
/** Override this to change asType behavior. */
/*non-public*/ MethodHandle asTypeUncached(MethodType newType) {
if (!type.isConvertibleTo(newType))
throw new WrongMethodTypeException("cannot convert "+this+" to "+newType);
! return asTypeCache = MethodHandleImpl.makePairwiseConvert(this, newType, 1);
! return asTypeCache = MethodHandleImpl.makePairwiseConvert(this, newType, true);
}
/**
* Makes an <em>array-spreading</em> method handle, which accepts a trailing array argument
* and spreads its elements as positional arguments.
*** 974,984 ****
--- 974,984 ----
public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
asCollectorChecks(arrayType, arrayLength);
int collectArgPos = type().parameterCount()-1;
MethodHandle target = this;
if (arrayType != type().parameterType(collectArgPos))
! target = MethodHandleImpl.makePairwiseConvert(this, type().changeParameterType(collectArgPos, arrayType), 1);
! target = MethodHandleImpl.makePairwiseConvert(this, type().changeParameterType(collectArgPos, arrayType), true);
MethodHandle collector = MethodHandleImpl.varargsArray(arrayType, arrayLength);
return MethodHandles.collectArguments(target, collectArgPos, collector);
}
/**
src/share/classes/java/lang/invoke/MethodHandle.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File