ObjectHelper - newInstance - minor bug with not wrapping correct caused exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ObjectHelper - newInstance - minor bug with not wrapping correct caused exception

Claus Ibsen
Hi

I will commit a minor fix for ObjectHelper that hides the orginal cause exception when instantiating a new class, eg using the bean type, such as:
                from("seda:errorTest").to("mock:a").bean(MyBadBean.class).to("mock:b");



Before:
=======
org.apache.camel.RuntimeCamelException
        at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:607)

After:
=======
org.apache.camel.RuntimeCamelException: java.lang.InstantiationException: org.apache.camel.issues.BelasThreadErrorHandlerIssue901Test$MyBadBean
        at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:607)




Med venlig hilsen

Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

Reply | Threaded
Open this post in threaded view
|

Re: ObjectHelper - newInstance - minor bug with not wrapping correct caused exception

jstrachan
2008/10/11 Claus Ibsen <[hidden email]>:

> Hi
>
> I will commit a minor fix for ObjectHelper that hides the orginal cause exception when instantiating a new class, eg using the bean type, such as:
>                from("seda:errorTest").to("mock:a").bean(MyBadBean.class).to("mock:b");
>
>
>
> Before:
> =======
> org.apache.camel.RuntimeCamelException
>        at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:607)
>
> After:
> =======
> org.apache.camel.RuntimeCamelException: java.lang.InstantiationException: org.apache.camel.issues.BelasThreadErrorHandlerIssue901Test$MyBadBean
>        at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:607)

Great stuff! :)
--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/