Buggy code:
public class ExecTaskTest extends BuildFileTest { private static final String BUILD_PATH = "src//etc//testcases//taskdefs//exec//" ; private static final String BUILD_FILE = ( ExecTaskTest . BUILD_PATH ) + "exec.xml" ; private final int TIME_TO_WAIT = 1 ; private final int MAX_BUILD_TIME = 4000 ; private final int SECURITY_MARGIN = 2000 ; private File logFile ; private ExecTaskTest . MonitoredBuild myBuild = null ; private volatile boolean buildFinished = false ; public ExecTaskTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testNoRedirect ( ) { } public void testRedirect1 ( ) throws IOException { } public void testRedirect2 ( ) throws IOException { } public void testRedirect3 ( ) throws IOException { } public void testRedirect4 ( ) throws IOException { } public void testRedirect5 ( ) throws IOException { } public void testRedirect6 ( ) throws IOException { } public void testRedirect5or6 ( String target ) throws IOException { } public void testRedirect7 ( ) throws IOException { } public void testRedirector1 ( ) { } public void testRedirector2 ( ) throws IOException { } public void testRedirector3 ( ) throws IOException { } public void testRedirector4 ( ) throws IOException { } public void testRedirector5 ( ) throws IOException { } public void testRedirector6 ( ) throws IOException { } private void testRedirector5or6 ( String target ) throws IOException { } public void testRedirector7 ( ) throws IOException { } public void testRedirector8 ( ) throws IOException { } public void testRedirector9 ( ) throws IOException { } public void testRedirector10 ( ) throws IOException { } public void testRedirector11 ( ) throws IOException { } public void testRedirector12 ( ) throws IOException { } private void testRedirector9Thru12 ( String target ) throws IOException { } public void testRedirector13 ( ) { } public void testRedirector14 ( ) { } public void testRedirector15 ( ) throws IOException { } public void testRedirector16 ( ) { } public void testRedirector17 ( ) { } public void testRedirector18 ( ) { } public void testspawn ( ) { project . executeTarget ( "init" ) ; if ( ( project . getProperty ( "test.can.run" ) ) == null ) { return ; } <START_BUG> myBuild = new ExecTaskTest . MonitoredBuild ( new File ( ExecTaskTest . BUILD_FILE ) , "spawn" ) ; <END_BUG> FileUtils fileutils = FileUtils . newFileUtils ( ) ; logFile = fileutils . createTempFile ( "spawn" , "log" , project . getBaseDir ( ) ) ; assertTrue ( "log<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>existing" , ( ! ( logFile . exists ( ) ) ) ) ; myBuild . setTimeToWait ( TIME_TO_WAIT ) ; myBuild . setLogFile ( logFile . getAbsolutePath ( ) ) ; myBuild . addBuildListener ( new ExecTaskTest . MonitoredBuildListener ( ) ) ; myBuild . start ( ) ; GregorianCalendar startwait = new GregorianCalendar ( ) ; while ( ! ( buildFinished ) ) { try { Thread . sleep ( 10 ) ; } catch ( InterruptedException e ) { System . out . println ( "my<seq2seq4repair_space>sleep<seq2seq4repair_space>was<seq2seq4repair_space>interrupted" ) ; } GregorianCalendar now = new GregorianCalendar ( ) ; if ( ( ( now . getTime ( ) . getTime ( ) ) - ( startwait . getTime ( ) . getTime ( ) ) ) > ( MAX_BUILD_TIME ) ) { System . out . println ( ( ( "aborting<seq2seq4repair_space>wait,<seq2seq4repair_space>too<seq2seq4repair_space>long<seq2seq4repair_space>" + ( ( now . getTime ( ) . getTime ( ) ) - ( startwait . getTime ( ) . getTime ( ) ) ) ) + "milliseconds" ) ) ; break ; } } try { Thread . sleep ( ( ( ( TIME_TO_WAIT ) * 1000 ) + ( SECURITY_MARGIN ) ) ) ; } catch ( InterruptedException e ) { System . out . println ( "my<seq2seq4repair_space>sleep<seq2seq4repair_space>was<seq2seq4repair_space>interrupted" ) ; } long elapsed = myBuild . getTimeElapsed ( ) ; assertTrue ( "we<seq2seq4repair_space>waited<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>the<seq2seq4repair_space>process<seq2seq4repair_space>lasted" , ( ( ( ( TIME_TO_WAIT ) * 1000 ) + ( SECURITY_MARGIN ) ) > elapsed ) ) ; logFile = new File ( logFile . getAbsolutePath ( ) ) ; assertTrue ( "log<seq2seq4repair_space>file<seq2seq4repair_space>found<seq2seq4repair_space>after<seq2seq4repair_space>spawn" , logFile . exists ( ) ) ; } private static class MonitoredBuild implements Runnable { private Thread worker ; private File myBuildFile = null ; private String target = null ; private Project project = null ; private int timeToWait = 0 ; private String logFile = null ; private GregorianCalendar timeStarted = null ; private GregorianCalendar timeFinished = null ; public void setLogFile ( String logFile ) { } public void setTimeToWait ( int timeToWait ) { } public void addBuildListener ( BuildListener bl ) { } public MonitoredBuild ( File buildFile , String target ) { } public long getTimeElapsed ( ) { } public void start ( ) { } public void run ( ) { } private void startProject ( ) { } } private class MonitoredBuildListener implements BuildListener { public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { } } private String getFileString ( String filename ) throws IOException { } }

Fix:
myBuild = new ExecTaskTest . MonitoredBuild ( new File ( System . getProperty ( "root" ) , ExecTaskTest . BUILD_FILE ) , "spawn" ) ;