ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@mad.scientist.com>
Subject Re: ClassLoader ?
Date Thu, 10 Aug 2000 01:32:13 GMT
At 03:53  9/8/00 -0700, you wrote:
>As far as I understood the difference is in which ClassLoader space 'blah'
>will be loaded. If you use *only* system class loader there is no
>difference,
>if you use your own class loaders you can drop into the problem (for example
>with security), cause first method loads class in the namespace of system
>(bootstrap)
>class loader, second in the namespace of class from the left of .getClass().

yep thats right so.

getClass().getClassLoader().loadClass("blah")

loads blah from classloader that was used to load current class. This means
if you use classloaders that expand your classpath then you will always
load from primeordial rather than current.

There are also some serious issues when you need to resolve classes that
occur higher up in classpath hierarchy that require classes lower down or
when you are running in a secured environment 1.2+ (Specifically with
associating ProtectedDomains to CodeSources)






Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Mime
View raw message