diff options
Diffstat (limited to 'src/main/org/apache/tools/ant/taskdefs/WhichResource.java')
-rw-r--r-- | src/main/org/apache/tools/ant/taskdefs/WhichResource.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/WhichResource.java b/src/main/org/apache/tools/ant/taskdefs/WhichResource.java index d19918aef..73ad77976 100644 --- a/src/main/org/apache/tools/ant/taskdefs/WhichResource.java +++ b/src/main/org/apache/tools/ant/taskdefs/WhichResource.java @@ -105,14 +105,11 @@ public class WhichResource extends Task { setcount++; } - if (setcount == 0) { - throw new BuildException("One of classname or resource must" - + " be specified"); + throw new BuildException("One of classname or resource must be specified"); } if (setcount > 1) { - throw new BuildException("Only one of classname or resource can" - + " be specified"); + throw new BuildException("Only one of classname or resource can be specified"); } if (property == null) { throw new BuildException("No property defined"); @@ -123,6 +120,7 @@ public class WhichResource extends Task { * execute it * @throws BuildException on error */ + @Override public void execute() throws BuildException { validate(); if (classpath != null) { @@ -154,8 +152,7 @@ public class WhichResource extends Task { } log("Searching for " + resource, Project.MSG_VERBOSE); - URL url; - url = loader.getResource(resource); + URL url = loader.getResource(resource); if (url != null) { //set the property loc = url.toExternalForm(); |