Buggy code:
public class JUnitTask extends Task { private CommandlineJava commandline = new CommandlineJava ( ) ; private Vector tests = new Vector ( ) ; private Vector batchTests = new Vector ( ) ; private Vector formatters = new Vector ( ) ; private File dir = null ; private Integer timeout = null ; private boolean summary = false ; private String summaryValue = "" ; public void setHaltonerror ( boolean value ) { } public void setErrorProperty ( String propertyName ) { } public void setHaltonfailure ( boolean value ) { } public void setFailureProperty ( String propertyName ) { } public void setFork ( boolean value ) { } public void setPrintsummary ( JUnitTask . SummaryAttribute value ) { } public static class SummaryAttribute extends EnumeratedAttribute { public String [ ] getValues ( ) { } public boolean asBoolean ( ) { } } public void setTimeout ( Integer value ) { } 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 Path createClasspath ( ) { } public void addTest ( JUnitTest test ) { } public BatchTest createBatchTest ( ) { } public void addFormatter ( FormatterElement fe ) { } public JUnitTask ( ) throws Exception { } public void init ( ) { } public void execute ( ) throws BuildException { } protected void execute ( JUnitTest test ) throws BuildException { } private int executeAsForked ( JUnitTest test , ExecuteWatchdog watchdog ) throws BuildException { } private int executeInVM ( JUnitTest test ) throws BuildException { test . setProperties ( project . getProperties ( ) ) ; if ( ( dir ) != null ) { log ( "dir<seq2seq4repair_space>attribute<seq2seq4repair_space>ignored<seq2seq4repair_space>if<seq2seq4repair_space>running<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>VM" , MSG_WARN ) ; } CommandlineJava . SysProperties sysProperties = commandline . getSystemProperties ( ) ; if ( sysProperties != null ) { sysProperties . setSystem ( ) ; } try { log ( ( "Using<seq2seq4repair_space>System<seq2seq4repair_space>properties<seq2seq4repair_space>" + ( System . getProperties ( ) ) ) , MSG_VERBOSE ) ; AntClassLoader cl = null ; Path classpath = commandline . getClasspath ( ) ; if ( classpath != null ) { log ( ( "Using<seq2seq4repair_space>CLASSPATH<seq2seq4repair_space>" + classpath ) , MSG_VERBOSE ) ; <START_BUG> cl = new AntClassLoader ( project , classpath , false ) ; <END_BUG> cl . addSystemPackageRoot ( "junit" ) ; cl . addSystemPackageRoot ( "org.apache.tools.ant" ) ; } JUnitTestRunner runner = new JUnitTestRunner ( test , test . getHaltonerror ( ) , test . getHaltonfailure ( ) , cl ) ; if ( summary ) { log ( ( "Running<seq2seq4repair_space>" + ( test . getName ( ) ) ) , MSG_INFO ) ; SummaryJUnitResultFormatter f = new SummaryJUnitResultFormatter ( ) ; f . setWithOutAndErr ( "withoutanderr" . equalsIgnoreCase ( summaryValue ) ) ; f . setOutput ( getDefaultOutput ( ) ) ; runner . addFormatter ( f ) ; } final FormatterElement [ ] feArray = mergeFormatters ( test ) ; for ( int i = 0 ; i < ( feArray . length ) ; i ++ ) { FormatterElement fe = feArray [ i ] ; File outFile = getOutput ( fe , test ) ; if ( outFile != null ) { fe . setOutfile ( outFile ) ; } else { fe . setOutput ( getDefaultOutput ( ) ) ; } runner . addFormatter ( fe . createFormatter ( ) ) ; } runner . run ( ) ; return runner . getRetCode ( ) ; } finally { if ( sysProperties != null ) { sysProperties . restoreSystem ( ) ; } } } protected ExecuteWatchdog createWatchdog ( ) throws BuildException { } protected OutputStream getDefaultOutput ( ) { } protected Enumeration getIndividualTests ( ) { } protected Enumeration allTests ( ) { } private FormatterElement [ ] mergeFormatters ( JUnitTest test ) { } protected File getOutput ( FormatterElement fe , JUnitTest test ) { } protected void addClasspathEntry ( String resource ) { } }

Fix:
cl = new AntClassLoader ( null , project , classpath , false ) ;