ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core TryCatchTask.java
Date Sun, 03 Mar 2002 06:41:57 GMT
donaldp     02/03/02 22:41:57

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/core
                        TryCatchTask.java
  Log:
  Use simplified AbstractContainerTask
  
  Revision  Changes    Path
  1.2       +5 -24     jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/TryCatchTask.java
  
  Index: TryCatchTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/TryCatchTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TryCatchTask.java	9 Feb 2002 04:49:46 -0000	1.1
  +++ TryCatchTask.java	3 Mar 2002 06:41:57 -0000	1.2
  @@ -12,15 +12,14 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.AbstractContainerTask;
  -import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.myrmidon.interfaces.executor.Executor;
  +import org.apache.myrmidon.framework.TaskList;
   
   /**
    * A task that emulates the try-catch-finally construct in a number
    * of languages.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/09 04:49:46 $
  + * @version $Revision: 1.2 $ $Date: 2002/03/03 06:41:57 $
    * @ant:task name="try-catch"
    */
   public final class TryCatchTask
  @@ -81,20 +80,17 @@
       {
           validate();
   
  -        final ExecutionFrame frame = (ExecutionFrame)getService( ExecutionFrame.class );
  -        final Executor executor = (Executor)getService( Executor.class );
  -
           try
           {
               final Configuration[] tasks = m_try.getTasks();
  -            executeTasks( executor, frame, tasks );
  +            executeTasks( tasks );
           }
           catch( final TaskException te )
           {
               if( null != m_catch )
               {
                   final Configuration[] tasks = m_catch.getTasks();
  -                executeTasks( executor, frame, tasks );
  +                executeTasks( tasks );
               }
               else
               {
  @@ -106,7 +102,7 @@
               if( null != m_finally )
               {
                   final Configuration[] tasks = m_finally.getTasks();
  -                executeTasks( executor, frame, tasks );
  +                executeTasks( tasks );
               }
           }
       }
  @@ -123,21 +119,6 @@
           {
               final String message = REZ.getString( "trycatch.missing-second.error" );
               throw new TaskException( message );
  -        }
  -    }
  -
  -    /**
  -     * Utility method to execute the tasks in an appropriate environment.
  -     */
  -    private void executeTasks( final Executor executor,
  -                               final ExecutionFrame frame,
  -                               final Configuration[] tasks )
  -        throws TaskException
  -    {
  -        for( int i = 0; i < tasks.length; i++ )
  -        {
  -            final Configuration task = tasks[ i ];
  -            executor.execute( task, frame );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message