ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <j_a_fernan...@yahoo.com>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types XCatalog.java
Date Mon, 11 Mar 2002 10:06:12 GMT
 --- Stefan Bodewig <bodewig@apache.org> wrote: > On
11 Mar 2002, <bodewig@apache.org> 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) {
     loader.setContextClassLoader(...);
  }

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
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message