Browse Source

Changed <available> to resolve relative resource names the same way as

<property> does.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268415 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
77ed2ceec5
2 changed files with 11 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/Available.java

+ 4
- 0
WHATSNEW View File

@@ -90,6 +90,10 @@ Fixed bugs:
* nested <classpath> elements of <taskdef> now work for <taskdef>s not
nested into <target> as well.

* <property> and <available> will search for the resource /foo instead
of /org/apache/tools/ant/taskdefs/foo when given a relative resource
name foo.

Changes from Ant 1.1 to Ant 1.2
===============================



+ 7
- 1
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -144,7 +144,13 @@ public class Available extends Task {
if (loader != null) {
return (loader.getResourceAsStream(resource) != null);
} else {
return (this.getClass().getResourceAsStream(resource) != null);
ClassLoader cL = this.getClass().getClassLoader();
if (cL != null) {
return (cL.getResourceAsStream(resource) != null);
} else {
return
(ClassLoader.getSystemResourceAsStream(resource) != null);
}
}
}



Loading…
Cancel
Save