commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Downey <steve.dow...@netfolio.com>
Subject Re: [lang] reflect - Class.forName
Date Sun, 24 Nov 2002 05:46:32 GMT
+1, as the reasoning seems quite sane.


On Saturday 23 November 2002 09:17 pm, Henri Yandell wrote:
> I've not really been paying attention to the reflect stuff, and had missed
> a question about it in a blog I usually read:
>
> http://radio.weblogs.com/0112098/2002/09/24.html#a114
>
> Rather than using:
>
> Class theClass = Class.forName( className );
>
> in reflect.ReflectionUtils, James suggests we should use:
>
> ****
> Class theClass = null;
>
> try {
>  theClass = Thread.currentThread().getContextClassLoader().loadClass(
> className );
> } catch (ClassNotFoundException e) {
>  theClass = getClass().getClassLoader().loadClass( className );
> }
> ****
>
> as "Class.forName is evil".
>
> Any views on this??
>
> Hen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message