Buggy code:
public class ExecTask extends Task { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private String os ; private String osFamily ; private File dir ; protected boolean failOnError = false ; protected boolean newEnvironment = false ; private Long timeout = null ; private Environment env = new Environment ( ) ; protected Commandline cmdl = new Commandline ( ) ; private String resultProperty ; private boolean failIfExecFails = true ; private String executable ; private boolean resolveExecutable = false ; private boolean searchPath = false ; private boolean spawn = false ; private boolean incompatibleWithSpawn = false ; private String inputString ; private File input ; private File output ; private File error ; protected Redirector redirector = new Redirector ( this ) ; protected RedirectorElement redirectorElement ; private boolean vmLauncher = true ; public ExecTask ( ) { } public ExecTask ( Task owner ) { } public void setSpawn ( boolean spawn ) { } public void setTimeout ( Long value ) { } public void setTimeout ( Integer value ) { } public void setExecutable ( String value ) { } public void setDir ( File d ) { } public void setOs ( String os ) { } public void setCommand ( Commandline cmdl ) { } public void setOutput ( File out ) { } public void setInput ( File input ) { } public void setInputString ( String inputString ) { } public void setLogError ( boolean logError ) { } public void setError ( File error ) { } public void setOutputproperty ( String outputProp ) { } public void setErrorProperty ( String errorProperty ) { } public void setFailonerror ( boolean fail ) { } public void setNewenvironment ( boolean newenv ) { } public void setResolveExecutable ( boolean resolveExecutable ) { } public void setSearchPath ( boolean searchPath ) { } public boolean getResolveExecutable ( ) { } public void addEnv ( Environment . Variable var ) { } public Argument createArg ( ) { } public void setResultProperty ( String resultProperty ) { } protected void maybeSetResultPropertyValue ( int result ) { } public void setFailIfExecutionFails ( boolean flag ) { } public void setAppend ( boolean append ) { } public void addConfiguredRedirector ( RedirectorElement redirectorElement ) { } public void setOsFamily ( String osFamily ) { } protected String resolveExecutable ( String exec , boolean mustSearchPath ) { if ( ! ( resolveExecutable ) ) { return exec ; } <START_BUG> File executableFile = ExecTask . FILE_UTILS . resolveFile ( getProject ( ) . getBaseDir ( ) , exec ) ; <END_BUG> if ( executableFile . exists ( ) ) { return executableFile . getAbsolutePath ( ) ; } if ( ( dir ) != null ) { executableFile = ExecTask . FILE_UTILS . resolveFile ( dir , exec ) ; if ( executableFile . exists ( ) ) { return executableFile . getAbsolutePath ( ) ; } } if ( mustSearchPath ) { Path p = null ; String [ ] environment = env . getVariables ( ) ; if ( environment != null ) { for ( int i = 0 ; i < ( environment . length ) ; i ++ ) { if ( isPath ( environment [ i ] ) ) { p = new Path ( getProject ( ) , environment [ i ] . substring ( 5 ) ) ; break ; } } } if ( p == null ) { Vector envVars = Execute . getProcEnvironment ( ) ; Enumeration e = envVars . elements ( ) ; while ( e . hasMoreElements ( ) ) { String line = ( ( String ) ( e . nextElement ( ) ) ) ; if ( isPath ( line ) ) { p = new Path ( getProject ( ) , line . substring ( 5 ) ) ; break ; } } } if ( p != null ) { String [ ] dirs = p . list ( ) ; for ( int i = 0 ; i < ( dirs . length ) ; i ++ ) { executableFile = ExecTask . FILE_UTILS . resolveFile ( new File ( dirs [ i ] ) , exec ) ; if ( executableFile . exists ( ) ) { return executableFile . getAbsolutePath ( ) ; } } } } return exec ; } public void execute ( ) throws BuildException { } protected void checkConfiguration ( ) throws BuildException { } protected void setupRedirector ( ) { } protected boolean isValidOs ( ) { } public void setVMLauncher ( boolean vmLauncher ) { } protected Execute prepareExec ( ) throws BuildException { } protected final void runExecute ( Execute exe ) throws IOException { } protected void runExec ( Execute exe ) throws BuildException { } protected ExecuteStreamHandler createHandler ( ) throws BuildException { } protected ExecuteWatchdog createWatchdog ( ) throws BuildException { } protected void logFlush ( ) { } private boolean isPath ( String line ) { } }

Fix:
File executableFile = getProject ( ) . resolveFile ( exec ) ;