ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Property.java
Date Thu, 30 Nov 2000 11:19:13 GMT
bodewig     00/11/30 03:19:12

  Modified:    src/main/org/apache/tools/ant/taskdefs Property.java
  Log:
  Fixed <property resource="...">. The old implementation would serach
  for org/apache/tools/ant/taskdefs/RESOURCE when RESOURCE was a
  relative filename (this is the main difference between
  Class.getResource and ClassLoader.getResource).
  
  Reported by:	Jason Rosenberg <jason@squaretrade.com>
  
  Revision  Changes    Path
  1.21      +9 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Property.java	2000/11/30 09:31:41	1.20
  +++ Property.java	2000/11/30 11:19:11	1.21
  @@ -178,7 +178,15 @@
           Properties props = new Properties();
           log("Resource Loading " + name, Project.MSG_VERBOSE);
           try {
  -            InputStream is = this.getClass().getResourceAsStream(name);
  +            ClassLoader cL = this.getClass().getClassLoader();
  +            InputStream is = null;
  +
  +            if (cL == null) {
  +                is = ClassLoader.getSystemResourceAsStream(name);
  +            } else {
  +                is = cL.getResourceAsStream(name);
  +            }
  +            
               if (is != null) {
                   props.load(is);
                   addProperties(props);
  
  
  

Mime
View raw message