ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Taskdef Classloader change (was RE: Custom Ant tasks and classpath issue)
Date Thu, 28 Feb 2002 11:12:52 GMT
On Thu, 28 Feb 2002, Vincent Massol <> wrote:

> My understanding is that there is a hierarchy in CL : there is a
> parent and there are children CL.


> When a children CL is asked to load a class, it looks first if it
> can find it. If it cannot it delegates the load to its parent
> classloader. Up until the system classloader.

No - the other way around, the child first asks the parent.  See the
API documentation of ClassLoader:

>>  The ClassLoader class uses a delegation model to search for
>>  classes and resources. Each instance of ClassLoader has an
>>  associated parent class loader. When called upon to find a class
>>  or resource, a ClassLoader instance will delegate the search for
>>  the class or resource to its parent class loader before attempting
>>  to find the class or resource itself.

That way, if two loaders, which are children of the same class loader,
try to load a class that can be found by the parent class loader as
well as the child loaders will both get the class from the parent
class loader instead of two incompatible version loaded by the


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

View raw message