conor 02/02/12 15:52:24
Modified: proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
ExecutionManager.java Frame.java
proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant
Ant1Factory.java
proposal/mutant/src/java/cli/org/apache/ant/cli
Commandline.java
Log:
Changes resulting from first run of gump with mutant
Revision Changes Path
1.8 +4 -1
jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java
Index: ExecutionManager.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- ExecutionManager.java 11 Feb 2002 15:42:18 -0000 1.7
+++ ExecutionManager.java 12 Feb 2002 23:52:23 -0000 1.8
@@ -155,8 +155,10 @@
* @param targets a list of target names to be executed.
* @param commandProperties the properties defined by the front end to
* control the build
+ * @exception AntException if there is a problem in the build
*/
- public void runBuild(Project project, List targets, Map
commandProperties) {
+ public void runBuild(Project project, List targets, Map
commandProperties)
+ throws AntException {
Throwable buildFailureCause = null;
try {
// start by validating the project we have been given.
@@ -178,6 +180,7 @@
throw e;
} catch (AntException e) {
buildFailureCause = e;
+ throw e;
} finally {
eventSupport.fireBuildFinished(project, buildFailureCause);
}
1.4 +12 -3
jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java
Index: Frame.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- Frame.java 12 Feb 2002 13:23:20 -0000 1.3
+++ Frame.java 12 Feb 2002 23:52:23 -0000 1.4
@@ -221,6 +221,10 @@
protected void setDataValue(String name, Object value, boolean mutable)
throws ExecutionException {
Frame frame = getContainingFrame(name);
+ if (frame == null) {
+ throw new ExecutionException("There is no project corresponding
"
+ + "to the name \"" + name + "\"");
+ }
if (frame == this) {
if (dataValues.containsKey(name) && !mutable) {
log("Ignoring oveeride for data value " + name,
@@ -399,6 +403,10 @@
*/
protected Object getDataValue(String name) throws ExecutionException {
Frame frame = getContainingFrame(name);
+ if (frame == null) {
+ throw new ExecutionException("There is no project corresponding
"
+ + "to the name \"" + name + "\"");
+ }
if (frame == this) {
return dataValues.get(name);
} else {
@@ -417,6 +425,10 @@
*/
protected boolean isDataValueSet(String name) throws ExecutionException {
Frame frame = getContainingFrame(name);
+ if (frame == null) {
+ throw new ExecutionException("There is no project corresponding
"
+ + "to the name \"" + name + "\"");
+ }
if (frame == this) {
return dataValues.containsKey(name);
} else {
@@ -864,9 +876,6 @@
private void createNestedElement(AntLibFactory factory, Setter setter,
Object element, BuildElement model)
throws ExecutionException {
- log("The use of create methods is deprecated - class: "
- + element.getClass().getName(), MessageLevel.MSG_INFO);
-
String nestedElementName = model.getType();
try {
Object nestedElement
1.7 +8 -6
jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Ant1Factory.java
Index: Ant1Factory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Ant1Factory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- Ant1Factory.java 8 Feb 2002 13:04:46 -0000 1.6
+++ Ant1Factory.java 12 Feb 2002 23:52:24 -0000 1.7
@@ -55,8 +55,8 @@
import org.apache.ant.common.antlib.AntContext;
import org.apache.ant.common.antlib.Converter;
import org.apache.ant.common.antlib.StandardLibFactory;
-import org.apache.ant.common.util.ExecutionException;
import org.apache.ant.common.service.EventService;
+import org.apache.ant.common.util.ExecutionException;
import org.apache.ant.init.LoaderUtils;
/**
@@ -105,12 +105,13 @@
* Create an instance of the requested type class
*
* @param typeClass the class from which an instance is required
+ * @param localName the name of the type within its library
* @return an instance of the requested class
* @exception ExecutionException the instance could not be created.
* @exception InstantiationException if the type cannot be instantiated
* @exception IllegalAccessException if the type cannot be accessed
*/
- public Object createTypeInstance(Class typeClass)
+ public Object createTypeInstance(Class typeClass, String localName)
throws InstantiationException, IllegalAccessException,
ExecutionException {
try {
@@ -145,11 +146,12 @@
* Create an instance of the requested task class
*
* @param taskClass the class from which an instance is required
+ * @param localName the name of the task within its library
* @return an instance of the requested class
* @exception InstantiationException if the task cannot be instantiated
* @exception IllegalAccessException if the task cannot be accessed
*/
- public Object createTaskInstance(Class taskClass)
+ public Object createTaskInstance(Class taskClass, String localName)
throws InstantiationException, IllegalAccessException {
Object instance = taskClass.newInstance();
if (instance instanceof ProjectComponent) {
1.8 +1 -22
jakarta-ant/proposal/mutant/src/java/cli/org/apache/ant/cli/Commandline.java
Index: Commandline.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/cli/org/apache/ant/cli/Commandline.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- Commandline.java 11 Feb 2002 15:42:19 -0000 1.7
+++ Commandline.java 12 Feb 2002 23:52:24 -0000 1.8
@@ -72,9 +72,7 @@
import org.apache.ant.antcore.xml.XMLParseException;
import org.apache.ant.common.event.BuildListener;
import org.apache.ant.common.model.Project;
-import org.apache.ant.common.util.AntException;
import org.apache.ant.common.util.ConfigException;
-import org.apache.ant.common.util.Location;
import org.apache.ant.common.event.MessageLevel;
import org.apache.ant.init.InitConfig;
import org.apache.ant.init.InitUtils;
@@ -297,27 +295,8 @@
addBuildListeners(executionManager);
executionManager.init();
executionManager.runBuild(project, targets, definedProperties);
+ System.exit(0);
} catch (Throwable t) {
- if (t instanceof AntException) {
- AntException e = (AntException)t;
- Location location = e.getLocation();
- Throwable cause = e.getCause();
- if (location != null && location !=
Location.UNKNOWN_LOCATION) {
- System.out.print(location);
- }
- System.out.println(e.getMessage());
-
- if (messageOutputLevel >= MessageLevel.MSG_VERBOSE) {
- t.printStackTrace();
- }
-
- if (cause != null) {
- System.out.println("Root cause: " + cause.toString());
- }
- } else {
- t.printStackTrace(System.err);
- }
-
System.exit(1);
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>