git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270188 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1,66 +0,0 @@ | |||||
/* | |||||
* Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
* | |||||
* This software is published under the terms of the Apache Software License | |||||
* version 1.1, a copy of which has been included with this distribution in | |||||
* the LICENSE file. | |||||
*/ | |||||
package org.apache.tools.ant; | |||||
import org.apache.myrmidon.api.TaskException; | |||||
/** | |||||
* Signals an error condition during a build. | |||||
* | |||||
* @author James Duncan Davidson | |||||
*/ | |||||
public class BuildException | |||||
extends TaskException | |||||
{ | |||||
/** | |||||
* Location in the build file where the exception occured | |||||
*/ | |||||
private Location location = Location.UNKNOWN_LOCATION; | |||||
/** | |||||
* Constructs an exception with the given descriptive message. | |||||
* | |||||
* @param msg Description of or information about the exception. | |||||
*/ | |||||
public BuildException( String msg ) | |||||
{ | |||||
super( msg ); | |||||
} | |||||
/** | |||||
* Constructs an exception with the given message and exception as a root | |||||
* cause. | |||||
* | |||||
* @param msg Description of or information about the exception. | |||||
* @param cause Throwable that might have cause this one. | |||||
*/ | |||||
public BuildException( String msg, Throwable cause ) | |||||
{ | |||||
super( msg, cause ); | |||||
} | |||||
/** | |||||
* Sets the file location where the error occured. | |||||
* | |||||
* @param location The new Location value | |||||
*/ | |||||
public void setLocation( Location location ) | |||||
{ | |||||
this.location = location; | |||||
} | |||||
/** | |||||
* Returns the file location where the error occured. | |||||
* | |||||
* @return The Location value | |||||
*/ | |||||
public Location getLocation() | |||||
{ | |||||
return location; | |||||
} | |||||
} |
@@ -9,6 +9,7 @@ package org.apache.tools.ant; | |||||
import java.io.PrintStream; | import java.io.PrintStream; | ||||
import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
import org.apache.myrmidon.api.TaskException; | |||||
/** | /** | ||||
* Writes build event to a PrintStream. Currently, it only writes which targets | * Writes build event to a PrintStream. Currently, it only writes which targets | ||||
@@ -118,13 +119,13 @@ public class DefaultLogger implements BuildLogger | |||||
message.append( StringUtils.LINE_SEP ); | message.append( StringUtils.LINE_SEP ); | ||||
if( Project.MSG_VERBOSE <= msgOutputLevel || | if( Project.MSG_VERBOSE <= msgOutputLevel || | ||||
!( error instanceof BuildException ) ) | |||||
!( error instanceof TaskException ) ) | |||||
{ | { | ||||
message.append( StringUtils.getStackTrace( error ) ); | message.append( StringUtils.getStackTrace( error ) ); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if( error instanceof BuildException ) | |||||
if( error instanceof TaskException ) | |||||
{ | { | ||||
message.append( error.toString() ).append( StringUtils.LINE_SEP ); | message.append( error.toString() ).append( StringUtils.LINE_SEP ); | ||||
} | } | ||||
@@ -287,7 +287,7 @@ public class IntrospectionHelper implements BuildListener | |||||
*/ | */ | ||||
public void setAttribute( Project p, Object element, String attributeName, | public void setAttribute( Project p, Object element, String attributeName, | ||||
String value ) | String value ) | ||||
throws BuildException | |||||
throws TaskException | |||||
{ | { | ||||
AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName ); | AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName ); | ||||
if( as == null ) | if( as == null ) | ||||
@@ -25,7 +25,7 @@ public class TaskAdapter extends Task | |||||
* Checks a class, whether it is suitable to be adapted by TaskAdapter. | * Checks a class, whether it is suitable to be adapted by TaskAdapter. | ||||
* Checks conditions only, which are additionally required for a tasks | * Checks conditions only, which are additionally required for a tasks | ||||
* adapted by TaskAdapter. Thus, this method should be called by {@link | * adapted by TaskAdapter. Thus, this method should be called by {@link | ||||
* Project#checkTaskClass}. Throws a BuildException and logs as | |||||
* Project#checkTaskClass}. Throws a TaskException and logs as | |||||
* Project.MSG_ERR for conditions, that will cause the task execution to | * Project.MSG_ERR for conditions, that will cause the task execution to | ||||
* fail. Logs other suspicious conditions with Project.MSG_WARN. | * fail. Logs other suspicious conditions with Project.MSG_WARN. | ||||
* | * | ||||
@@ -76,10 +76,10 @@ public class TaskAdapter extends Task | |||||
/** | /** | ||||
* Do the execution. | * Do the execution. | ||||
* | * | ||||
* @exception BuildException Description of Exception | |||||
* @exception TaskException Description of Exception | |||||
*/ | */ | ||||
public void execute() | public void execute() | ||||
throws BuildException | |||||
throws TaskException | |||||
{ | { | ||||
Method setProjectM = null; | Method setProjectM = null; | ||||
try | try | ||||
@@ -101,7 +101,7 @@ public class TaskAdapter extends Task | |||||
{ | { | ||||
log( "Error setting project in " + proxy.getClass(), | log( "Error setting project in " + proxy.getClass(), | ||||
Project.MSG_ERR ); | Project.MSG_ERR ); | ||||
throw new BuildException( "Error", ex ); | |||||
throw new TaskException( "Error", ex ); | |||||
} | } | ||||
Method executeM = null; | Method executeM = null; | ||||
@@ -120,7 +120,7 @@ public class TaskAdapter extends Task | |||||
catch( Exception ex ) | catch( Exception ex ) | ||||
{ | { | ||||
log( "Error in " + proxy.getClass(), Project.MSG_ERR ); | log( "Error in " + proxy.getClass(), Project.MSG_ERR ); | ||||
throw new BuildException( "Error", ex ); | |||||
throw new TaskException( "Error", ex ); | |||||
} | } | ||||
} | } | ||||
@@ -18,7 +18,6 @@ import java.util.StringTokenizer; | |||||
import java.util.TimeZone; | import java.util.TimeZone; | ||||
import java.util.Vector; | import java.util.Vector; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
@@ -12,7 +12,6 @@ import java.io.FileWriter; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | import org.apache.tools.ant.taskdefs.Execute; | ||||
import org.apache.tools.ant.taskdefs.Javac; | import org.apache.tools.ant.taskdefs.Javac; | ||||
@@ -28,7 +28,6 @@ import org.apache.bcel.classfile.*; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
@@ -1,66 +0,0 @@ | |||||
/* | |||||
* Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
* | |||||
* This software is published under the terms of the Apache Software License | |||||
* version 1.1, a copy of which has been included with this distribution in | |||||
* the LICENSE file. | |||||
*/ | |||||
package org.apache.tools.ant; | |||||
import org.apache.myrmidon.api.TaskException; | |||||
/** | |||||
* Signals an error condition during a build. | |||||
* | |||||
* @author James Duncan Davidson | |||||
*/ | |||||
public class BuildException | |||||
extends TaskException | |||||
{ | |||||
/** | |||||
* Location in the build file where the exception occured | |||||
*/ | |||||
private Location location = Location.UNKNOWN_LOCATION; | |||||
/** | |||||
* Constructs an exception with the given descriptive message. | |||||
* | |||||
* @param msg Description of or information about the exception. | |||||
*/ | |||||
public BuildException( String msg ) | |||||
{ | |||||
super( msg ); | |||||
} | |||||
/** | |||||
* Constructs an exception with the given message and exception as a root | |||||
* cause. | |||||
* | |||||
* @param msg Description of or information about the exception. | |||||
* @param cause Throwable that might have cause this one. | |||||
*/ | |||||
public BuildException( String msg, Throwable cause ) | |||||
{ | |||||
super( msg, cause ); | |||||
} | |||||
/** | |||||
* Sets the file location where the error occured. | |||||
* | |||||
* @param location The new Location value | |||||
*/ | |||||
public void setLocation( Location location ) | |||||
{ | |||||
this.location = location; | |||||
} | |||||
/** | |||||
* Returns the file location where the error occured. | |||||
* | |||||
* @return The Location value | |||||
*/ | |||||
public Location getLocation() | |||||
{ | |||||
return location; | |||||
} | |||||
} |
@@ -9,6 +9,7 @@ package org.apache.tools.ant; | |||||
import java.io.PrintStream; | import java.io.PrintStream; | ||||
import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
import org.apache.myrmidon.api.TaskException; | |||||
/** | /** | ||||
* Writes build event to a PrintStream. Currently, it only writes which targets | * Writes build event to a PrintStream. Currently, it only writes which targets | ||||
@@ -118,13 +119,13 @@ public class DefaultLogger implements BuildLogger | |||||
message.append( StringUtils.LINE_SEP ); | message.append( StringUtils.LINE_SEP ); | ||||
if( Project.MSG_VERBOSE <= msgOutputLevel || | if( Project.MSG_VERBOSE <= msgOutputLevel || | ||||
!( error instanceof BuildException ) ) | |||||
!( error instanceof TaskException ) ) | |||||
{ | { | ||||
message.append( StringUtils.getStackTrace( error ) ); | message.append( StringUtils.getStackTrace( error ) ); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if( error instanceof BuildException ) | |||||
if( error instanceof TaskException ) | |||||
{ | { | ||||
message.append( error.toString() ).append( StringUtils.LINE_SEP ); | message.append( error.toString() ).append( StringUtils.LINE_SEP ); | ||||
} | } | ||||
@@ -287,7 +287,7 @@ public class IntrospectionHelper implements BuildListener | |||||
*/ | */ | ||||
public void setAttribute( Project p, Object element, String attributeName, | public void setAttribute( Project p, Object element, String attributeName, | ||||
String value ) | String value ) | ||||
throws BuildException | |||||
throws TaskException | |||||
{ | { | ||||
AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName ); | AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName ); | ||||
if( as == null ) | if( as == null ) | ||||
@@ -25,7 +25,7 @@ public class TaskAdapter extends Task | |||||
* Checks a class, whether it is suitable to be adapted by TaskAdapter. | * Checks a class, whether it is suitable to be adapted by TaskAdapter. | ||||
* Checks conditions only, which are additionally required for a tasks | * Checks conditions only, which are additionally required for a tasks | ||||
* adapted by TaskAdapter. Thus, this method should be called by {@link | * adapted by TaskAdapter. Thus, this method should be called by {@link | ||||
* Project#checkTaskClass}. Throws a BuildException and logs as | |||||
* Project#checkTaskClass}. Throws a TaskException and logs as | |||||
* Project.MSG_ERR for conditions, that will cause the task execution to | * Project.MSG_ERR for conditions, that will cause the task execution to | ||||
* fail. Logs other suspicious conditions with Project.MSG_WARN. | * fail. Logs other suspicious conditions with Project.MSG_WARN. | ||||
* | * | ||||
@@ -76,10 +76,10 @@ public class TaskAdapter extends Task | |||||
/** | /** | ||||
* Do the execution. | * Do the execution. | ||||
* | * | ||||
* @exception BuildException Description of Exception | |||||
* @exception TaskException Description of Exception | |||||
*/ | */ | ||||
public void execute() | public void execute() | ||||
throws BuildException | |||||
throws TaskException | |||||
{ | { | ||||
Method setProjectM = null; | Method setProjectM = null; | ||||
try | try | ||||
@@ -101,7 +101,7 @@ public class TaskAdapter extends Task | |||||
{ | { | ||||
log( "Error setting project in " + proxy.getClass(), | log( "Error setting project in " + proxy.getClass(), | ||||
Project.MSG_ERR ); | Project.MSG_ERR ); | ||||
throw new BuildException( "Error", ex ); | |||||
throw new TaskException( "Error", ex ); | |||||
} | } | ||||
Method executeM = null; | Method executeM = null; | ||||
@@ -120,7 +120,7 @@ public class TaskAdapter extends Task | |||||
catch( Exception ex ) | catch( Exception ex ) | ||||
{ | { | ||||
log( "Error in " + proxy.getClass(), Project.MSG_ERR ); | log( "Error in " + proxy.getClass(), Project.MSG_ERR ); | ||||
throw new BuildException( "Error", ex ); | |||||
throw new TaskException( "Error", ex ); | |||||
} | } | ||||
} | } | ||||
@@ -18,7 +18,6 @@ import java.util.StringTokenizer; | |||||
import java.util.TimeZone; | import java.util.TimeZone; | ||||
import java.util.Vector; | import java.util.Vector; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
@@ -12,7 +12,6 @@ import java.io.FileWriter; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | import org.apache.tools.ant.taskdefs.Execute; | ||||
import org.apache.tools.ant.taskdefs.Javac; | import org.apache.tools.ant.taskdefs.Javac; | ||||
@@ -28,7 +28,6 @@ import org.apache.bcel.classfile.*; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
import org.apache.tools.ant.Location; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||