problem with vargs method
Jochen Theodorou
blackdrag at gmx.org
Tue Feb 7 08:04:30 PST 2012
Hi all,
maybe someone can explain to me why method handles behave this way in my
case.
Bascially I have a handle for Class#getDeclaredConstructor(Class...) I
created via unreflect.
http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getDeclaredConstructor%28java.lang.Class...%29
this handle is then created as a AdapterMethodHandle$AsVargsCollector.
My targetType is Object(Object,Object) and the arguments to the call are
the Class, and an empty Class[]. So the next steps are asType with the
target type, adding a guard with catch, then my guards for the arguments
and last I do an invokeWithArguments.
What I get now is a ClassCastException with the message required class
java.lang.Class but encountered class [Ljava.lang.Class;
The guards are unrelated to the problem, since it happens without them
as well.
Now can anyone explain me why I get that exception? It doesn't really
make sense to me atm.
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
More information about the mlvm-dev
mailing list