Loading... (original) (raw)

MethodHandles.insertArguments(MethodHandle target, int pos, Object... values) throws IllegalArgumentException if pos is an illegal index to the target's parameters array, or if there is too many values to insert, but Javadoc doesn't specify that.

For example, all the calls below throw IAE
==================================
MethodHandle mh = empty(methodType(void.class));
insertArguments(mh, -1);
insertArguments(mh, 1);
insertArguments(mh, 0, 1);
==================================