Hi,
I am getting this error message:
java.lang.IllegalArgumentException: target and combiner types must
match: (Object,int)int != (Object,int)int
either the message is misleading or they do in fact match and the check
is wrong.
What I did do is easy:
MethodHandle get = MethodHandles.arrayElementGetter(arrayClass); //
(int[],int):int
MethodHandle fallback = MethodHandles.explicitCastArguments(get,
get.type().changeParameterType(0, Object.class)); // (Object,int):int
fallback = MethodHandles.foldArguments(fallback, normalizeIndex);
normalizeIndex has the signature (Object,int):int and is a direct method
handle of a static method.
bye Jochen
--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog:
http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit
http://groovy-lang.org