donaldp     01/12/22 19:40:24

  Modified:    
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
  Log:
  Fix an error introduced in the Enumeration -> Iterator move
  
  Revision  Changes    Path
  1.14      +7 -6      
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JUnitTask.java    2001/12/23 00:10:44     1.13
  +++ JUnitTask.java    2001/12/23 03:40:24     1.14
  @@ -17,6 +17,7 @@
   import java.util.Iterator;
   import java.util.Properties;
   import java.util.Random;
  +import java.util.Enumeration;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.Project;
  @@ -659,23 +660,23 @@
           cmd.createArgument().setValue( "propsfile=" + 
propsFile.getAbsolutePath() );
           Hashtable p = getProject().getProperties();
           Properties props = new Properties();
  -        for( Iterator enum = p.keys(); enum.hasNext(); )
  +        for( Enumeration enum = p.keys(); enum.hasMoreElements(); )
           {
  -            Object key = enum.next();
  +            final Object key = enum.nextElement();
               props.put( key, p.get( key ) );
           }
           try
           {
  -            FileOutputStream outstream = new FileOutputStream( propsFile );
  +            final FileOutputStream outstream = new FileOutputStream( 
propsFile );
               props.save( outstream, "Ant JUnitTask generated properties file" 
);
               outstream.close();
           }
  -        catch( java.io.IOException e )
  +        catch( IOException ioe )
           {
  -            throw new TaskException( "Error creating temporary properties 
file.", e );
  +            throw new TaskException( "Error creating temporary properties 
file.", ioe );
           }
   
  -        Execute execute = new Execute( new LogStreamHandler( this, 
Project.MSG_INFO, Project.MSG_WARN ), watchdog );
  +        final Execute execute = new Execute( new LogStreamHandler( this, 
Project.MSG_INFO, Project.MSG_WARN ), watchdog );
           execute.setCommandline( cmd.getCommandline() );
           if( dir != null )
           {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to