git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272380 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -614,8 +614,7 @@ public class ComponentManager implements ComponentService { | |||||
| e.setLocation(location, false); | e.setLocation(location, false); | ||||
| throw e; | throw e; | ||||
| } catch (RuntimeException e) { | } catch (RuntimeException e) { | ||||
| throw new ExecutionException(e.getClass().getName() + ": " | |||||
| + e.getMessage(), e, location); | |||||
| throw new ExecutionException(e, location); | |||||
| } | } | ||||
| } | } | ||||
| @@ -662,8 +661,7 @@ public class ComponentManager implements ComponentService { | |||||
| e.setLocation(model.getLocation(), false); | e.setLocation(model.getLocation(), false); | ||||
| throw e; | throw e; | ||||
| } catch (RuntimeException 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 @@ public class ComponentManager implements ComponentService { | |||||
| e.setLocation(model.getLocation(), false); | e.setLocation(model.getLocation(), false); | ||||
| throw e; | throw e; | ||||
| } catch (RuntimeException e) { | } catch (RuntimeException e) { | ||||
| throw new ExecutionException(e.getClass().getName() + ": " | |||||
| + e.getMessage(), e, model.getLocation()); | |||||
| throw new ExecutionException(e, model.getLocation()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -118,10 +118,12 @@ public class CoreExecService implements ExecService { | |||||
| task.execute(); | task.execute(); | ||||
| LoaderUtils.setContextLoader(currentLoader); | LoaderUtils.setContextLoader(currentLoader); | ||||
| } catch (ExecutionException e) { | |||||
| failureCause = e; | |||||
| throw e; | |||||
| } catch (Throwable e) { | } catch (Throwable e) { | ||||
| ExecutionException ee = | ExecutionException ee = | ||||
| new ExecutionException(e.getClass().getName() + ": " | |||||
| + e.getMessage(), e); | |||||
| new ExecutionException(e); | |||||
| failureCause = ee; | failureCause = ee; | ||||
| throw ee; | throw ee; | ||||
| @@ -72,7 +72,6 @@ import org.apache.ant.common.service.EventService; | |||||
| import org.apache.ant.common.service.ExecService; | import org.apache.ant.common.service.ExecService; | ||||
| import org.apache.ant.common.service.FileService; | import org.apache.ant.common.service.FileService; | ||||
| import org.apache.ant.common.service.MagicProperties; | 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.ConfigException; | ||||
| import org.apache.ant.common.util.DemuxOutputReceiver; | import org.apache.ant.common.util.DemuxOutputReceiver; | ||||
| import org.apache.ant.common.util.ExecutionException; | import org.apache.ant.common.util.ExecutionException; | ||||
| @@ -696,16 +695,12 @@ public class Frame implements DemuxOutputReceiver { | |||||
| setDataValue(typeId, component, true); | setDataValue(typeId, component, true); | ||||
| } | } | ||||
| } | } | ||||
| } catch (AntException te) { | |||||
| ExecutionException e | |||||
| = new ExecutionException(te, te.getLocation()); | |||||
| } catch (ExecutionException e) { | |||||
| e.setLocation(model.getLocation(), false); | e.setLocation(model.getLocation(), false); | ||||
| throw e; | throw e; | ||||
| } catch (RuntimeException e) { | } catch (RuntimeException e) { | ||||
| ExecutionException ee = | ExecutionException ee = | ||||
| new ExecutionException(e.getClass().getName() + ": " | |||||
| + e.getMessage(), e, model.getLocation()); | |||||
| new ExecutionException(e, model.getLocation()); | |||||
| throw ee; | throw ee; | ||||
| } | } | ||||
| @@ -755,8 +750,7 @@ public class Frame implements DemuxOutputReceiver { | |||||
| throw e; | throw e; | ||||
| } catch (RuntimeException e) { | } catch (RuntimeException e) { | ||||
| ExecutionException ee = | ExecutionException ee = | ||||
| new ExecutionException(e.getClass().getName() + ": " | |||||
| + e.getMessage(), e, target.getLocation()); | |||||
| new ExecutionException(e, target.getLocation()); | |||||
| failureCause = ee; | failureCause = ee; | ||||
| throw ee; | throw ee; | ||||
| @@ -174,7 +174,7 @@ public class DefaultLogger implements BuildLogger { | |||||
| t.printStackTrace(out); | t.printStackTrace(out); | ||||
| } | } | ||||
| if (cause != null) { | |||||
| if (!cause.getMessage().equals(t.getMessage())) { | |||||
| out.println("Root cause: " + cause.toString()); | out.println("Root cause: " + cause.toString()); | ||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -114,7 +114,8 @@ public abstract class AntException extends Exception { | |||||
| * @param cause Exception that might have caused this one. | * @param cause Exception that might have caused this one. | ||||
| */ | */ | ||||
| public AntException(Throwable cause) { | public AntException(Throwable cause) { | ||||
| super(cause.getMessage()); | |||||
| super(cause.getMessage() == null | |||||
| ? cause.getClass().getName() : cause.getMessage()); | |||||
| this.cause = cause; | this.cause = cause; | ||||
| } | } | ||||