anirudha-wegilant / lambdaj

Automatically exported from code.google.com/p/lambdaj
Apache License 2.0
0 stars 0 forks source link

Unwrap InvocationTargetException for Runtime Exceptions #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have some code that looks like this:

Lambda.forEach(list, MyClass.class).myMethod();

If "myMethod()" throws a runtime exception for one of the values in the list, I 
was expecting to be able to catch that runtime exception. But instead I get an 
UndeclaredThrowableException being propagated.

An InvocationTargetException is being generated by the call to method.invoke in 
ch.lambdaj.proxy.ProxyIterator.iterateOnValues(Method, Object[])

And because myMethod doesn't declare InvocationTargetException this ends up 
wrapped in a UndeclaredThrowableException by Dynamic proxy.

Original issue reported on code.google.com by flamingp...@gmail.com on 24 Jan 2012 at 12:28

GoogleCodeExporter commented 8 years ago
Fixed in lambdaj 2.4

Original comment by mario.fu...@gmail.com on 29 Jan 2012 at 6:43