Browse Source

whitespace

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@373716 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 19 years ago
parent
commit
86860e58da
1 changed files with 44 additions and 44 deletions
  1. +44
    -44
      src/main/org/apache/tools/ant/taskdefs/Available.java

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

@@ -234,54 +234,54 @@ public class Available extends Task implements Condition {
*/
public boolean eval() throws BuildException {
try {
if (classname == null && file == null && resource == null) {
throw new BuildException("At least one of (classname|file|"
+ "resource) is required", getLocation());
}
if (type != null) {
if (file == null) {
throw new BuildException("The type attribute is only valid "
+ "when specifying the file "
+ "attribute.", getLocation());
if (classname == null && file == null && resource == null) {
throw new BuildException("At least one of (classname|file|"
+ "resource) is required", getLocation());
}
}
if (classpath != null) {
classpath.setProject(getProject());
this.loader = getProject().createClassLoader(classpath);
}
String appendix = "";
if (isTask) {
appendix = " to set property " + property;
} else {
setTaskName("available");
}
if ((classname != null) && !checkClass(classname)) {
log("Unable to load class " + classname + appendix,
Project.MSG_VERBOSE);
return false;
}
if ((file != null) && !checkFile()) {
StringBuffer buf = new StringBuffer("Unable to find ");
if (type != null) {
buf.append(type).append(' ');
if (file == null) {
throw new BuildException("The type attribute is only valid "
+ "when specifying the file "
+ "attribute.", getLocation());
}
}
if (classpath != null) {
classpath.setProject(getProject());
this.loader = getProject().createClassLoader(classpath);
}
String appendix = "";
if (isTask) {
appendix = " to set property " + property;
} else {
setTaskName("available");
}
if ((classname != null) && !checkClass(classname)) {
log("Unable to load class " + classname + appendix,
Project.MSG_VERBOSE);
return false;
}
if ((file != null) && !checkFile()) {
StringBuffer buf = new StringBuffer("Unable to find ");
if (type != null) {
buf.append(type).append(' ');
}
buf.append(filename).append(appendix);
log(buf.toString(), Project.MSG_VERBOSE);
return false;
}
if ((resource != null) && !checkResource(resource)) {
log("Unable to load resource " + resource + appendix,
Project.MSG_VERBOSE);
return false;
}
buf.append(filename).append(appendix);
log(buf.toString(), Project.MSG_VERBOSE);
return false;
}
if ((resource != null) && !checkResource(resource)) {
log("Unable to load resource " + resource + appendix,
Project.MSG_VERBOSE);
return false;
}
} finally {
if (loader != null) {
loader.cleanup();
loader = null;
}
if (!isTask) {
setTaskName(null);
}
if (loader != null) {
loader.cleanup();
loader = null;
}
if (!isTask) {
setTaskName(null);
}
}
return true;
}


Loading…
Cancel
Save