conor 01/02/11 04:29:29
Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_13_BRANCH
Available.java
Log:
Make available give more information when it fails to set a property
Revision Changes Path
No revision
No revision
1.17.2.1 +14 -5
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java
Index: Available.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -r1.17 -r1.17.2.1
--- Available.java 2001/02/03 14:07:34 1.17
+++ Available.java 2001/02/11 12:29:29 1.17.2.1
@@ -129,9 +129,20 @@
this.loader = new AntClassLoader(project, classpath, false);
}
- if ((classname != null) && !checkClass(classname)) return;
- if ((file != null) && !checkFile(file)) return;
- if ((resource != null) && !checkResource(resource)) return;
+ if ((classname != null) && !checkClass(classname)) {
+ log("Unable to load class " + classname + " to set property " +
property, Project.MSG_VERBOSE);
+ return;
+ }
+
+ if ((file != null) && !checkFile(file)) {
+ log("Unable to find file " + file + " to set property " +
property, Project.MSG_VERBOSE);
+ return;
+ }
+
+ if ((resource != null) && !checkResource(resource)) {
+ log("Unable to load resource " + resource + " to set property "
+ property, Project.MSG_VERBOSE);
+ return;
+ }
this.project.setProperty(property, value);
}
@@ -170,10 +181,8 @@
}
return true;
} catch (ClassNotFoundException e) {
- log("Class not found: " + classname, Project.MSG_VERBOSE);
return false;
} catch (NoClassDefFoundError e) {
- log("Class cound not be loaded: " + classname,
Project.MSG_VERBOSE);
return false;
}
}