ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [PROPOSAL] No need for CLASSPATH in ANT1
Date Sun, 11 Nov 2001 23:52:27 GMT
On Mon, 12 Nov 2001 10:38, Ted Neward wrote:
> If you want to be *really* technical about it, the example
>
> > URLClassLoader classLoader = new URLClassLoader( myURLs );
> >
> > where they would need to do something like
> >
> > URLClassLoader classLoader = new URLClassLoader( myURLs,
> >             this.getClass().getClassLoader() );
>
> really highlights a bug in the Java Class Libraries, and isn't an
> Ant-specific problem whatsoever--the default "parent" argument is always
> the System ClassLoader (the sun.misc.AppClassLoader), when it should be the
> ClassLoader of the class that's executing the current call
> (getCallerClassLoader()).

God no - that would be horrible. Setting the parent to ClassLoader would 
vastly increase the complexity of ClassLoader setups. This would break 
virtually every EJB/servlet engine out there and cause massive portability 
headaches. Coupling behaviour to the ClassLoader that happened to load the 
Class would be a nightmare. We already have enough of these heaches dealing 
with making sure dependent Classes are in current ClassLoader or parent 
ClassLoaders.

If you were to claim that all ClassLoaders use the ContextClassLoader then 
that may be viable but can't ever change for backwards compatibility reasons.

-- 
Cheers,

Pete

---------------------------------------------------
"Marriage, Friends, Religon -- these are the demons 
you must slay in order to suceed in business.." 
                 -- Mr. Burns, The Simpsons 
---------------------------------------------------


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


Mime
View raw message