Browse Source

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
master
Jacobus Martinus Kruithof 20 years ago
parent
commit
af67c9bf8f
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      src/main/org/apache/tools/ant/taskdefs/Ant.java

+ 5
- 7
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -31,13 +31,11 @@ import java.util.HashSet;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.DefaultLogger; import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Executor;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.ProjectHelper;
import org.apache.tools.ant.Target; import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task; 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.types.PropertySet;
import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.util.FileUtils;


@@ -389,18 +387,18 @@ public class Ant extends Task {


if (locals.size() > 0 && !(locals.size() == 1 if (locals.size() > 0 && !(locals.size() == 1
&& locals.get(0) == "")) { && locals.get(0) == "")) {
Throwable t = null;
BuildException be = null;
try { try {
log("Entering " + antFile + "...", Project.MSG_VERBOSE); log("Entering " + antFile + "...", Project.MSG_VERBOSE);
newProject.fireSubBuildStarted(); newProject.fireSubBuildStarted();
newProject.executeTargets(locals); newProject.executeTargets(locals);
} catch (BuildException ex) { } catch (BuildException ex) {
t = ProjectHelper
be = ProjectHelper
.addLocationToBuildException(ex, getLocation()); .addLocationToBuildException(ex, getLocation());
throw (BuildException) t;
throw be;
} finally { } finally {
log("Exiting " + antFile + ".", Project.MSG_VERBOSE); log("Exiting " + antFile + ".", Project.MSG_VERBOSE);
newProject.fireSubBuildFinished(t);
newProject.fireSubBuildFinished(be);
} }
} }
} finally { } finally {
@@ -593,7 +591,7 @@ public class Ant extends Task {
/** /**
* The build file to use. Defaults to "build.xml". This file is expected * The build file to use. Defaults to "build.xml". This file is expected
* to be a filename relative to the dir attribute given. * to be a filename relative to the dir attribute given.
* @param s the <code>String</code> build file name.
* @param antFile the <code>String</code> build file name.
*/ */
public void setAntfile(String antFile) { public void setAntfile(String antFile) {
// @note: it is a string and not a file to handle relative/absolute // @note: it is a string and not a file to handle relative/absolute


Loading…
Cancel
Save