conor 02/04/11 08:24:18
Modified: proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
ComponentManager.java CoreExecService.java
Frame.java
proposal/mutant/src/java/cli/org/apache/ant/cli
DefaultLogger.java
proposal/mutant/src/java/common/org/apache/ant/common/util
AntException.java
Log:
Better error reporting for mutant
Revision Changes Path
1.13 +3 -6
jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ComponentManager.java
Index: ComponentManager.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ComponentManager.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- ComponentManager.java 7 Apr 2002 14:38:06 -0000 1.12
+++ ComponentManager.java 11 Apr 2002 15:24:18 -0000 1.13
@@ -614,8 +614,7 @@
e.setLocation(location, false);
throw e;
} catch (RuntimeException e) {
- throw new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e, location);
+ throw new ExecutionException(e, location);
}
}
@@ -662,8 +661,7 @@
e.setLocation(model.getLocation(), false);
throw e;
} catch (RuntimeException e) {
- throw new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e, model.getLocation());
+ throw new ExecutionException(e, model.getLocation());
}
}
@@ -786,8 +784,7 @@
e.setLocation(model.getLocation(), false);
throw e;
} catch (RuntimeException e) {
- throw new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e, model.getLocation());
+ throw new ExecutionException(e, model.getLocation());
}
}
1.10 +4 -2
jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java
Index: CoreExecService.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- CoreExecService.java 9 Apr 2002 12:23:53 -0000 1.9
+++ CoreExecService.java 11 Apr 2002 15:24:18 -0000 1.10
@@ -118,10 +118,12 @@
task.execute();
LoaderUtils.setContextLoader(currentLoader);
+ } catch (ExecutionException e) {
+ failureCause = e;
+ throw e;
} catch (Throwable e) {
ExecutionException ee =
- new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e);
+ new ExecutionException(e);
failureCause = ee;
throw ee;
1.17 +3 -9
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.16
retrieving revision 1.17
diff -u -w -u -r1.16 -r1.17
--- Frame.java 9 Apr 2002 12:23:53 -0000 1.16
+++ Frame.java 11 Apr 2002 15:24:18 -0000 1.17
@@ -72,7 +72,6 @@
import org.apache.ant.common.service.ExecService;
import org.apache.ant.common.service.FileService;
import org.apache.ant.common.service.MagicProperties;
-import org.apache.ant.common.util.AntException;
import org.apache.ant.common.util.ConfigException;
import org.apache.ant.common.util.DemuxOutputReceiver;
import org.apache.ant.common.util.ExecutionException;
@@ -696,16 +695,12 @@
setDataValue(typeId, component, true);
}
}
- } catch (AntException te) {
- ExecutionException e
- = new ExecutionException(te, te.getLocation());
-
+ } catch (ExecutionException e) {
e.setLocation(model.getLocation(), false);
throw e;
} catch (RuntimeException e) {
ExecutionException ee =
- new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e, model.getLocation());
+ new ExecutionException(e, model.getLocation());
throw ee;
}
@@ -755,8 +750,7 @@
throw e;
} catch (RuntimeException e) {
ExecutionException ee =
- new ExecutionException(e.getClass().getName() + ": "
- + e.getMessage(), e, target.getLocation());
+ new ExecutionException(e, target.getLocation());
failureCause = ee;
throw ee;
1.10 +1 -1
jakarta-ant/proposal/mutant/src/java/cli/org/apache/ant/cli/DefaultLogger.java
Index: DefaultLogger.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/cli/org/apache/ant/cli/DefaultLogger.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- DefaultLogger.java 7 Apr 2002 14:38:07 -0000 1.9
+++ DefaultLogger.java 11 Apr 2002 15:24:18 -0000 1.10
@@ -174,7 +174,7 @@
t.printStackTrace(out);
}
- if (cause != null) {
+ if (!cause.getMessage().equals(t.getMessage())) {
out.println("Root cause: " + cause.toString());
}
} else {
1.6 +2 -1
jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/util/AntException.java
Index: AntException.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/util/AntException.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- AntException.java 18 Mar 2002 02:44:27 -0000 1.5
+++ AntException.java 11 Apr 2002 15:24:18 -0000 1.6
@@ -114,7 +114,8 @@
* @param cause Exception that might have caused this one.
*/
public AntException(Throwable cause) {
- super(cause.getMessage());
+ super(cause.getMessage() == null
+ ? cause.getClass().getName() : cause.getMessage());
this.cause = cause;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>