Browse Source

Fix an error introduced in the Enumeration -> Iterator move

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270348 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
44b8feb32d
2 changed files with 14 additions and 12 deletions
  1. +7
    -6
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  2. +7
    -6
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

+ 7
- 6
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -17,6 +17,7 @@ import java.util.Hashtable;
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 @@ public class JUnitTask extends Task
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 )
{


+ 7
- 6
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -17,6 +17,7 @@ import java.util.Hashtable;
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 @@ public class JUnitTask extends Task
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 )
{


Loading…
Cancel
Save