Browse Source

Lets say tata to the BuildException.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270188 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
956c3e0843
14 changed files with 18 additions and 154 deletions
  1. +0
    -66
      proposal/myrmidon/src/main/org/apache/tools/ant/BuildException.java
  2. +3
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/DefaultLogger.java
  3. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/IntrospectionHelper.java
  4. +5
    -5
      proposal/myrmidon/src/main/org/apache/tools/ant/TaskAdapter.java
  5. +0
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  6. +0
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  7. +0
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  8. +0
    -66
      proposal/myrmidon/src/todo/org/apache/tools/ant/BuildException.java
  9. +3
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/DefaultLogger.java
  10. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/IntrospectionHelper.java
  11. +5
    -5
      proposal/myrmidon/src/todo/org/apache/tools/ant/TaskAdapter.java
  12. +0
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Tstamp.java
  13. +0
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  14. +0
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java

+ 0
- 66
proposal/myrmidon/src/main/org/apache/tools/ant/BuildException.java View File

@@ -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;
}
}

+ 3
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/DefaultLogger.java View File

@@ -9,6 +9,7 @@ package org.apache.tools.ant;

import java.io.PrintStream;
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
@@ -118,13 +119,13 @@ public class DefaultLogger implements BuildLogger
message.append( StringUtils.LINE_SEP );

if( Project.MSG_VERBOSE <= msgOutputLevel ||
!( error instanceof BuildException ) )
!( error instanceof TaskException ) )
{
message.append( StringUtils.getStackTrace( error ) );
}
else
{
if( error instanceof BuildException )
if( error instanceof TaskException )
{
message.append( error.toString() ).append( StringUtils.LINE_SEP );
}


+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -287,7 +287,7 @@ public class IntrospectionHelper implements BuildListener
*/
public void setAttribute( Project p, Object element, String attributeName,
String value )
throws BuildException
throws TaskException
{
AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName );
if( as == null )


+ 5
- 5
proposal/myrmidon/src/main/org/apache/tools/ant/TaskAdapter.java View File

@@ -25,7 +25,7 @@ public class TaskAdapter extends Task
* Checks a class, whether it is suitable to be adapted by TaskAdapter.
* Checks conditions only, which are additionally required for a tasks
* 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
* fail. Logs other suspicious conditions with Project.MSG_WARN.
*
@@ -76,10 +76,10 @@ public class TaskAdapter extends Task
/**
* Do the execution.
*
* @exception BuildException Description of Exception
* @exception TaskException Description of Exception
*/
public void execute()
throws BuildException
throws TaskException
{
Method setProjectM = null;
try
@@ -101,7 +101,7 @@ public class TaskAdapter extends Task
{
log( "Error setting project in " + proxy.getClass(),
Project.MSG_ERR );
throw new BuildException( "Error", ex );
throw new TaskException( "Error", ex );
}

Method executeM = null;
@@ -120,7 +120,7 @@ public class TaskAdapter extends Task
catch( Exception ex )
{
log( "Error in " + proxy.getClass(), Project.MSG_ERR );
throw new BuildException( "Error", ex );
throw new TaskException( "Error", ex );
}

}


+ 0
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java View File

@@ -18,7 +18,6 @@ import java.util.StringTokenizer;
import java.util.TimeZone;
import java.util.Vector;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.EnumeratedAttribute;


+ 0
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -12,7 +12,6 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.Javac;


+ 0
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java View File

@@ -28,7 +28,6 @@ import org.apache.bcel.classfile.*;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;


+ 0
- 66
proposal/myrmidon/src/todo/org/apache/tools/ant/BuildException.java View File

@@ -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;
}
}

+ 3
- 2
proposal/myrmidon/src/todo/org/apache/tools/ant/DefaultLogger.java View File

@@ -9,6 +9,7 @@ package org.apache.tools.ant;

import java.io.PrintStream;
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
@@ -118,13 +119,13 @@ public class DefaultLogger implements BuildLogger
message.append( StringUtils.LINE_SEP );

if( Project.MSG_VERBOSE <= msgOutputLevel ||
!( error instanceof BuildException ) )
!( error instanceof TaskException ) )
{
message.append( StringUtils.getStackTrace( error ) );
}
else
{
if( error instanceof BuildException )
if( error instanceof TaskException )
{
message.append( error.toString() ).append( StringUtils.LINE_SEP );
}


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -287,7 +287,7 @@ public class IntrospectionHelper implements BuildListener
*/
public void setAttribute( Project p, Object element, String attributeName,
String value )
throws BuildException
throws TaskException
{
AttributeSetter as = (AttributeSetter)attributeSetters.get( attributeName );
if( as == null )


+ 5
- 5
proposal/myrmidon/src/todo/org/apache/tools/ant/TaskAdapter.java View File

@@ -25,7 +25,7 @@ public class TaskAdapter extends Task
* Checks a class, whether it is suitable to be adapted by TaskAdapter.
* Checks conditions only, which are additionally required for a tasks
* 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
* fail. Logs other suspicious conditions with Project.MSG_WARN.
*
@@ -76,10 +76,10 @@ public class TaskAdapter extends Task
/**
* Do the execution.
*
* @exception BuildException Description of Exception
* @exception TaskException Description of Exception
*/
public void execute()
throws BuildException
throws TaskException
{
Method setProjectM = null;
try
@@ -101,7 +101,7 @@ public class TaskAdapter extends Task
{
log( "Error setting project in " + proxy.getClass(),
Project.MSG_ERR );
throw new BuildException( "Error", ex );
throw new TaskException( "Error", ex );
}

Method executeM = null;
@@ -120,7 +120,7 @@ public class TaskAdapter extends Task
catch( Exception ex )
{
log( "Error in " + proxy.getClass(), Project.MSG_ERR );
throw new BuildException( "Error", ex );
throw new TaskException( "Error", ex );
}

}


+ 0
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Tstamp.java View File

@@ -18,7 +18,6 @@ import java.util.StringTokenizer;
import java.util.TimeZone;
import java.util.Vector;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.EnumeratedAttribute;


+ 0
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -12,7 +12,6 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.Javac;


+ 0
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java View File

@@ -28,7 +28,6 @@ import org.apache.bcel.classfile.*;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;


Loading…
Cancel
Save