ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types
Date Mon, 11 Mar 2002 10:06:12 GMT
 --- Stefan Bodewig <> wrote: > On
11 Mar 2002, <> wrote:
> >   incomplete in the case of XCatalog, I'll follow
> up on this.
> XCatalog uses File.toURL and
> Thread.getContextClassloader - I didn't
> dive into the code deep enough to see whether we can
> work around them.
> If not, the class itself must be moved out of the
> types directory as
> bootstrap.(sh|bat) will fail on JDK 1.1 otherwise.

Thread.getContextClassloader can be replaced by the
corresponding method in AntClassLoader. That one uses
reflection. So you just need to do:

  if (loader isinstanceof AntClassLoader) {

or the equivalent for "get". If it is not an
AntClassLoader, then it is the system classpath so
context does not matter.

About File.toURL() I have seen code trying to imitate
this behaviour in several places. I think we should
add a method to the FileUtils so that we have one
centralized implementation. That should help alot.

> Anyway, as long as XCatalog requires JDK 1.2,
> <style> and all other
> tasks that add support for catalogs will become JDK
> 1.2 only tasks as
> well.  I don't like this effect at all.

Agreed. But I think we can fix it quite easily.

Jose Alberto

Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

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

View raw message