commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: [lang] enhanced version of Class.forName
Date Tue, 06 Sep 2005 07:33:09 GMT
Hi Thomas,

Thomas Dudziak wrote on Tuesday, September 06, 2005 9:09 AM:

> * the direct usage of types (Integer.TYPE etc.) has obviously
> problems in environments with multiple class loaders (eg.
> Class.forName(String name, boolean initialize, ClassLoader
> classLoader); likewise there may or may not be issues with
> using static in this context

Just out of curiosity: Why? These classes will always come from the system classloader ...

> * int.class is not guaranteed to be equal to Integer.class

Any reference? I am quite sure, that this will break a lot of apps (at least those who rely
on DataInput/DataOutput). And you would no longer be able to serialize between different runtimes

> * Class.forName is known to be problematic in certain
> circumstances/environments; using
> Thread.currentThread().getContextClassLoader() might be more
> useful (as Henri/Stephen suggested).
> I'll add an issue for this in BugZilla with my code attached,
> and you guys can decide whether it is useful to include in
> commons-lang, ok ? 
> regards,
> Tom

Thanks for anwering,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message