On Thu, 4 Oct 2001, Carsten Ziegeler <[EMAIL PROTECTED]> wrote: > 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?
A feature. This is how Java expects a classloader to behave - actually if you write a Classloader you are expected to search the the parent classloader first, Ant can be tricked to use the user-supplied classpath first, but this is not what a well behaved Classloader should do. > Is it planned to add an optional attribute to the available task to > specify the behaviour of this search? Don't know - currently it simply checks whether you could find the class in an AntClassLoader. I guess you have a different need, could you explain what you are trying to do? > 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. You may want to use a constructor that also sets useParentFirst to false - maybe AntClassLoader.setIsolated should also set useParentFirst if its argument is true. Conor? Stefan
