ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject Bug in available Task?
Date Thu, 04 Oct 2001 10:13:14 GMT

we recently had the problem with Cocoon 2 that the
"available" task always searches not only in the 
given classpath for a class but also in the parent
classloader (= jdk classpath). The documentation 
for the "available" task is not very clear about this.
Is this a bug or a feature? I personally would call
this a bug, because if I specify:
    <available classpathref="classpath" 
I assume that the class is only used in the classpath
defined by classpathref. 

Looking at the source I saw that the AntClassLoader
theoretically supports the "isolated" feature
which prevents searching in parent class loaders.
Is it planned to add an optional attribute to
the available task to specify the behaviour of
this search? 
(Cocoon 2 really needs this, I wrote a much
simpler task myself which only checks the given
path for the class - but does not try to load it).

However just patching the Available class to
support setting the isolated flag on the classloader
is not enough as the isolated flag seems not to 
be evaluated correctly. For example the loadClass()
method always calls isParentFirst(), but in insolated
mode the parent should never be queried.


Open Source Group                        sunShine - b:Integrated
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn                          mailto: 

View raw message