Buggy code:
public void setFiltertrace ( boolean value ) { } 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 setForkMode ( JUnitTask . ForkMode mode ) { } 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 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 ) { } private void preConfigure ( BaseTest test ) { } 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 setOutputToFormatters ( boolean outputToFormatters ) { } public void setLogFailedTests ( boolean logFailedTests ) { } public void addAssertions ( Assertions asserts ) { } public Permissions createPermissions ( ) { } public void setCloneVm ( boolean cloneVm ) { } public JUnitTask ( ) throws Exception { } public void setTempdir ( File tmpDir ) { } public void setEnableTestListenerEvents ( boolean b ) { } public boolean getEnableTestListenerEvents ( ) { } public void init ( ) { } private static JUnitTaskMirror createMirror ( JUnitTask task , ClassLoader loader ) { } protected void setupJUnitDelegate ( ) { } public void execute ( ) throws BuildException { } protected void execute ( JUnitTest arg ) throws BuildException { } private void validateTestName ( String testName ) throws BuildException { } protected void execute ( List testList ) throws BuildException { } private JUnitTask . TestResultHolder executeAsForked ( JUnitTest test , ExecuteWatchdog watchdog , File casesFile ) throws BuildException { } private void checkIncludeAntRuntime ( CommandlineJava cmd ) { } private boolean equalsWithOutAndErr ( String summaryOption ) { } private void checkIncludeSummary ( CommandlineJava cmd ) { } private void checkForkedPath ( CommandlineJava cmd ) { } private static boolean urlEquals ( URL u1 , URL u2 ) { } private static String maybeStripJarAndClass ( URL u ) { } private File createTempPropertiesFile ( String prefix ) { } protected void handleOutput ( String output ) { } protected int handleInput ( byte [ ] buffer , int offset , int length ) throws IOException { } protected void handleFlush ( String output ) { } public void handleErrorOutput ( String output ) { } public void handleErrorFlush ( String output ) { } private JUnitTask . TestResultHolder executeInVM ( JUnitTest arg ) throws BuildException { } protected ExecuteWatchdog createWatchdog ( ) throws BuildException { } protected OutputStream getDefaultOutput ( ) { } protected Enumeration getIndividualTests ( ) { } private void checkMethodLists ( ) throws BuildException { } protected Enumeration allTests ( ) { } private FormatterElement [ ] mergeFormatters ( JUnitTest test ) { } protected File getOutput ( FormatterElement fe , JUnitTest test ) { } protected void addClasspathEntry ( String resource ) { } private boolean addClasspathResource ( String resource ) { if ( resource . startsWith ( "//" ) ) { resource = resource . substring ( 1 ) ; } else { resource = "org//apache//tools//ant//taskdefs//optional//junit//" + resource ; } <START_BUG> File f = LoaderUtils . getResourceSource ( getClass ( ) . getClassLoader ( ) , resource ) ; <END_BUG> if ( f != null ) { log ( ( "Found<seq2seq4repair_space>" + ( f . getAbsolutePath ( ) ) ) , MSG_DEBUG ) ; antRuntimeClasses . createPath ( ) . setLocation ( f ) ; return true ; } else { log ( ( "Couldn\'t<seq2seq4repair_space>find<seq2seq4repair_space>" + resource ) , MSG_DEBUG ) ; return false ; } } static final String TIMEOUT_MESSAGE = "Timeout<seq2seq4repair_space>occurred.<seq2seq4repair_space>Please<seq2seq4repair_space>note<seq2seq4repair_space>the<seq2seq4repair_space>time<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>report<seq2seq4repair_space>does" + "<seq2seq4repair_space>not<seq2seq4repair_space>reflect<seq2seq4repair_space>the<seq2seq4repair_space>time<seq2seq4repair_space>until<seq2seq4repair_space>the<seq2seq4repair_space>timeout." ; private void logTimeout ( FormatterElement [ ] feArray , JUnitTest test , String testCase ) { } private void logVmCrash ( FormatterElement [ ] feArray , JUnitTest test , String testCase ) { } private void logVmExit ( FormatterElement [ ] feArray , JUnitTest test , String message , String testCase ) { } private void createClassLoader ( ) { } protected void cleanup ( ) { } private void deleteClassLoader ( ) { } protected CommandlineJava getCommandline ( ) { } private static final class ForkedTestConfiguration { private boolean filterTrace ; private boolean haltOnError ; private boolean haltOnFailure ; private String errorProperty ; private String failureProperty ; ForkedTestConfiguration ( boolean filterTrace , boolean haltOnError , boolean haltOnFailure , String errorProperty , String failureProperty ) { } ForkedTestConfiguration ( JUnitTest test ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } } public static final class ForkMode extends EnumeratedAttribute { public static final String ONCE = "once" ; public static final String PER_TEST = "perTest" ; public static final String PER_BATCH = "perBatch" ; public ForkMode ( ) { } public ForkMode ( String value ) { } public String [ ] getValues ( ) { } } protected Collection executeOrQueue ( Enumeration testList , boolean runIndividual ) { } protected void actOnTestResult ( int exitValue , boolean wasKilled , JUnitTest test , String name ) { }

Fix:
File f = LoaderUtils . getResourceSource ( JUnitTask . class . getClassLoader ( ) , resource ) ;