Menu

#17 invoke in FastMethod throwing InvocationTargetException

open
nobody
None
5
2006-05-03
2006-05-03
Anonymous
No

If you invoke a FastMethod with an inappropriate
array of arguments it throws an
InvocationTargetException wrapping a
ClassCastException. This is different to the
behaviour of java.lang.reflect.Method which documents
and throws an IllegalArgumentException in this
circumstance. With FastMethod it is not possible to
distinguish between the cases (1) The method was
called but happened to throw a ClassCastException and
(2) The method had the wrong signature. I kind of
expected FastMethod to be a drop in replacement for
Method, which it is except in this regard.

Discussion