On Thu, 18 Sep 2003 11:41 pm, Stefan Bodewig wrote:
> On Thu, 18 Sep 2003, Conor MacNeill <[EMAIL PROTECTED]>
> >
> > I don't think this will work. No matter which classloader you use to
> > find the class, if it is found on the system class loader it will
> > try to load dependent classes with the same loader.
>
> Sure?

No, of course not :-)

>
> Say Launcher wouldn't pass null but its URLClassLoader into Main and
> it would end up as being the core loader of Project - it looks as if
> it was supposed to be that way anyway, if you trust the comments in
> Main and Project except for the one for Main#startAnt 8-)
>

I wouldn't trust the comments. The concept of a core loader is not actively 
used in Ant. It was an experiment which was effectivekly discontinued. Its 
presence was benign so was not removed.

> OK, further on, make project.getCoreLoader the parent in
> AntClassLoader if you don't have an explicit parent.

We could do that. In fact I think there is a bug report requesting that.

>
> With that we should end up with AntClassLoader delegating to the one
> created in Launcher - and if we could get this one to not delegate to
> the system loader, we should be there, no?
>

The issue comes from getting it to not delegate. Not delegating is not really 
valid behaviour for class loaders and can cause issues. I know we do it i 
places already but I still have reservations.

A classloader that does not delegate to the system loader needs to know which 
classes it should delegate and which it should not. We do that already so 
maybe not a big issue apart from maintenance updates. 

This approach in the end is really the same as not using the CLASSPATH 
variable. After all, if we don't delegate, we wont find the classes the user 
has put in their classpath which brings us back to square 1.

We can enforce ignore CLASSPATH in the scripts so why not just do that  
forcibly ignore the CLASSPATH variable.

Conor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to