From af67c9bf8ffc275f7a9c9c74d94dbbf41b51544d Mon Sep 17 00:00:00 2001 From: Jacobus Martinus Kruithof Date: Sun, 22 May 2005 19:48:25 +0000 Subject: [PATCH] Avoiding Throwable while BuildException was actually meant git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278329 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Ant.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index f7d2ca35b..dbc69dd23 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -31,13 +31,11 @@ import java.util.HashSet; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.DefaultLogger; -import org.apache.tools.ant.Executor; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Target; import org.apache.tools.ant.Task; -import org.apache.tools.ant.helper.SingleCheckExecutor; import org.apache.tools.ant.types.PropertySet; import org.apache.tools.ant.util.FileUtils; @@ -389,18 +387,18 @@ public class Ant extends Task { if (locals.size() > 0 && !(locals.size() == 1 && locals.get(0) == "")) { - Throwable t = null; + BuildException be = null; try { log("Entering " + antFile + "...", Project.MSG_VERBOSE); newProject.fireSubBuildStarted(); newProject.executeTargets(locals); } catch (BuildException ex) { - t = ProjectHelper + be = ProjectHelper .addLocationToBuildException(ex, getLocation()); - throw (BuildException) t; + throw be; } finally { log("Exiting " + antFile + ".", Project.MSG_VERBOSE); - newProject.fireSubBuildFinished(t); + newProject.fireSubBuildFinished(be); } } } finally { @@ -593,7 +591,7 @@ public class Ant extends Task { /** * The build file to use. Defaults to "build.xml". This file is expected * to be a filename relative to the dir attribute given. - * @param s the String build file name. + * @param antFile the String build file name. */ public void setAntfile(String antFile) { // @note: it is a string and not a file to handle relative/absolute