ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners TaskToProjectListenerAdapter.java
Date Sat, 11 May 2002 12:18:52 GMT
adammurdoch    02/05/11 05:18:52

  Modified:    api/src/java/org/apache/myrmidon/listeners
                        TaskToProjectListenerAdapter.java
  Log:
  Don't include a task name in ProjectEvent if we're not actually executing a task.
  
  Revision  Changes    Path
  1.4       +9 -6      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/TaskToProjectListenerAdapter.java
  
  Index: TaskToProjectListenerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/TaskToProjectListenerAdapter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TaskToProjectListenerAdapter.java	26 Apr 2002 03:08:22 -0000	1.3
  +++ TaskToProjectListenerAdapter.java	11 May 2002 12:18:52 -0000	1.4
  @@ -16,7 +16,7 @@
    * the {@link ProjectListener} interface.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/04/26 03:08:22 $
  + * @version $Revision: 1.4 $ $Date: 2002/05/11 12:18:52 $
    */
   public class TaskToProjectListenerAdapter
       implements TaskListener
  @@ -62,7 +62,7 @@
        *
        * @param event the TaskEvent
        */
  -    public void taskMessage( TaskEvent event )
  +    public void taskMessage( final TaskEvent event )
       {
           final ProjectEvent projectEvent = toProjectEvent( event );
           m_listener.log( projectEvent );
  @@ -74,7 +74,7 @@
        *
        * @param event the TaskEvent
        */
  -    public void taskFinished( TaskEvent event )
  +    public void taskFinished( final TaskEvent event )
       {
           final ProjectEvent projectEvent = toProjectEvent( event );
           if( null == projectEvent.getTarget() )
  @@ -105,17 +105,20 @@
           String projectName = null;
           String targetName = null;
           String taskName = null;
  -        if( 1 <= elements.length )
  +        if( elements.length >= 1 )
           {
               projectName = elements[ 0 ];
           }
   
  -        if( 2 <= elements.length )
  +        if( elements.length >= 2 )
           {
               targetName = elements[ 1 ];
           }
   
  -        taskName = event.getName();
  +        if( elements.length >= 3 )
  +        {
  +            taskName = elements[ elements.length - 1 ];
  +        }
   
           return new ProjectEvent( event,
                                    projectName,
  
  
  

--
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