Buggy code:
public void setMaxmemory ( String max ) { } public void setJvm ( String value ) { } public Argument createJvmarg ( ) { } public void setDir ( File dir ) { } public void addSysproperty ( Environment . Variable sysp ) { } public void addConfiguredSysproperty ( Environment . Variable sysp ) { } public void addSyspropertyset ( PropertySet sysp ) { } public Path createClasspath ( ) { } public Path createBootclasspath ( ) { } public void addEnv ( Environment . Variable var ) { } public void setNewenvironment ( boolean newenv ) { } public void addTest ( JUnitTest test ) { } public BatchTest createBatchTest ( ) { } public void addFormatter ( FormatterElement fe ) { } public void setIncludeantruntime ( boolean b ) { } public void setShowOutput ( boolean showOutput ) { } public void setAssertions ( Assertions asserts ) { } public Permissions createPermissions ( ) { } public JUnitTask ( ) throws Exception { } public void setTempdir ( File tmpDir ) { } public void init ( ) { } public void execute ( ) throws BuildException { } protected void execute ( JUnitTest arg ) throws BuildException { } private int executeAsForked ( JUnitTest test , ExecuteWatchdog watchdog ) throws BuildException { if ( ( perm ) != null ) { log ( "Permissions<seq2seq4repair_space>ignored<seq2seq4repair_space>when<seq2seq4repair_space>running<seq2seq4repair_space>in<seq2seq4repair_space>forked<seq2seq4repair_space>mode!" , MSG_WARN ) ; } CommandlineJava cmd = ( ( CommandlineJava ) ( commandline . clone ( ) ) ) ; cmd . setClassname ( "org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" ) ; cmd . createArgument ( ) . setValue ( test . getName ( ) ) ; cmd . createArgument ( ) . setValue ( ( "filtertrace=" + ( test . getFiltertrace ( ) ) ) ) ; cmd . createArgument ( ) . setValue ( ( "haltOnError=" + ( test . getHaltonerror ( ) ) ) ) ; cmd . createArgument ( ) . setValue ( ( "haltOnFailure=" + ( test . getHaltonfailure ( ) ) ) ) ; if ( includeAntRuntime ) { log ( ( ( "Implicitly<seq2seq4repair_space>adding<seq2seq4repair_space>" + ( antRuntimeClasses ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>CLASSPATH" ) , MSG_VERBOSE ) ; cmd . createClasspath ( getProject ( ) ) . createPath ( ) . append ( antRuntimeClasses ) ; } if ( summary ) { log ( ( "Running<seq2seq4repair_space>" + ( test . getName ( ) ) ) , MSG_INFO ) ; cmd . createArgument ( ) . setValue ( ( "formatter" + "=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormatter" ) ) ; } cmd . createArgument ( ) . setValue ( ( "showoutput=" + ( String . valueOf ( showOutput ) ) ) ) ; StringBuffer formatterArg = new StringBuffer ( JUnitTask . STRING_BUFFER_SIZE ) ; final FormatterElement [ ] feArray = mergeFormatters ( test ) ; for ( int i = 0 ; i < ( feArray . length ) ; i ++ ) { FormatterElement fe = feArray [ i ] ; if ( fe . shouldUse ( this ) ) { formatterArg . append ( "formatter=" ) ; formatterArg . append ( fe . getClassname ( ) ) ; File outFile = getOutput ( fe , test ) ; if ( outFile != null ) { formatterArg . append ( "," ) ; formatterArg . append ( outFile ) ; } cmd . createArgument ( ) . setValue ( formatterArg . toString ( ) ) ; formatterArg = new StringBuffer ( ) ; } } File propsFile = FileUtils . newFileUtils ( ) . createTempFile ( "junit" , ".properties" , ( ( tmpDir ) != null ? tmpDir : getProject ( ) . getBaseDir ( ) ) ) ; cmd . createArgument ( ) . setValue ( ( "propsfile=" + ( propsFile . getAbsolutePath ( ) ) ) ) ; Hashtable p = getProject ( ) . getProperties ( ) ; Properties props = new Properties ( ) ; for ( Enumeration e = p . keys ( ) ; e . hasMoreElements ( ) ; ) { Object key = e . nextElement ( ) ; props . put ( key , p . get ( key ) ) ; } try { FileOutputStream outstream = new FileOutputStream ( propsFile ) ; <START_BUG> props . save ( outstream , "Ant<seq2seq4repair_space>JUnitTask<seq2seq4repair_space>generated<seq2seq4repair_space>properties<seq2seq4repair_space>file" ) ; <END_BUG> outstream . close ( ) ; } catch ( IOException e ) { propsFile . delete ( ) ; throw new BuildException ( ( "Error<seq2seq4repair_space>creating<seq2seq4repair_space>temporary<seq2seq4repair_space>properties<seq2seq4repair_space>" + "file." ) , e , getLocation ( ) ) ; } Execute execute = new Execute ( new org . apache . tools . ant . taskdefs . LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) , watchdog ) ; execute . setCommandline ( cmd . getCommandline ( ) ) ; execute . setAntRun ( getProject ( ) ) ; if ( ( dir ) != null ) { execute . setWorkingDirectory ( dir ) ; } String [ ] environment = env . getVariables ( ) ; if ( environment != null ) { for ( int i = 0 ; i < ( environment . length ) ; i ++ ) { log ( ( "Setting<seq2seq4repair_space>environment<seq2seq4repair_space>variable:<seq2seq4repair_space>" + ( environment [ i ] ) ) , MSG_VERBOSE ) ; } } execute . setNewenvironment ( newEnvironment ) ; execute . setEnvironment ( environment ) ; log ( cmd . describeCommand ( ) , MSG_VERBOSE ) ; int retVal ; try { retVal = execute . execute ( ) ; } catch ( IOException e ) { throw new BuildException ( "Process<seq2seq4repair_space>fork<seq2seq4repair_space>failed." , e , getLocation ( ) ) ; } finally { if ( ( watchdog != null ) && ( watchdog . killedProcess ( ) ) ) { logTimeout ( feArray , test ) ; } if ( ! ( propsFile . delete ( ) ) ) { throw new BuildException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>delete<seq2seq4repair_space>temporary<seq2seq4repair_space>" + "properties<seq2seq4repair_space>file." ) ) ; } } return retVal ; } protected void handleOutput ( String output ) { }

Fix:
props . store ( outstream , "Ant<seq2seq4repair_space>JUnitTask<seq2seq4repair_space>generated<seq2seq4repair_space>properties<seq2seq4repair_space>file" ) ;