Buggy code:
public class ExecuteJava { private static final Resources REZ = ResourceManager . getPackageResources ( ExecuteJava . class ) ; private final Path m_classPath = new Path ( ) ; private final EnvironmentData m_sysProperties = new EnvironmentData ( ) ; private final Commandline m_args = new Commandline ( ) ; private final Commandline m_vmArgs = new Commandline ( ) ; private boolean m_fork ; private File m_workingDirectory ; private File m_jar ; private String m_jvm ; private String m_className ; private String m_maxMemory ; private boolean m_ignoreReturnCode ; public void setClassName ( final String className ) { } public void setJar ( final File jar ) { } public void setFork ( final boolean fork ) { } public void setMaxMemory ( final String maxMemory ) { } public void setWorkingDirectory ( final File workingDirectory ) { } public void setIgnoreReturnCode ( boolean ignore ) { } public void setJvm ( final String jvm ) { } public Path getClassPath ( ) { } public EnvironmentData getSysProperties ( ) { } public Commandline getArguments ( ) { } public Commandline getVmArguments ( ) { } public void execute ( final TaskContext context ) throws TaskException { } public void executeNonForked ( final TaskContext context ) throws TaskException { if ( ( m_className ) == null ) { final String message = ExecuteJava . REZ . getString ( "executejava.no-classname.error" ) ; throw new TaskException ( message ) ; } if ( ( m_jar ) != null ) { final String message = ExecuteJava . REZ . getString ( "executejava.jar-no-fork.error" ) ; throw new TaskException ( message ) ; } if ( ( m_vmArgs . size ( ) ) > 0 ) { final String message = ExecuteJava . REZ . getString ( "executejava.ignore-jvm-args.notice" ) ; context . warn ( message ) ; } if ( ( m_workingDirectory ) != null ) { final String message = ExecuteJava . REZ . getString ( "executejava.ignore-dir.notice" ) ; context . warn ( message ) ; } if ( ( m_maxMemory ) != null ) { final String message = ExecuteJava . REZ . getString ( "executejava.ignore-maxmem.notice" ) ; context . warn ( message ) ; } if ( ( m_sysProperties . size ( ) ) > 0 ) { final String message = ExecuteJava . REZ . getString ( "executejava.ignore-sys-props.notice" ) ; context . warn ( message ) ; } final String [ ] args = m_args . getArguments ( ) ; if ( context . isVerboseEnabled ( ) ) { final String debugMessage = ExecuteJava . REZ . getString ( "executejava.exec-in-jvm.notice" , m_className , FileUtils . formatCommandLine ( args ) ) ; context . verbose ( debugMessage ) ; } <START_BUG> final Class target ; <END_BUG> try { final ClassLoader classLoader = PathUtil . createClassLoader ( m_classPath , context ) ; target = classLoader . loadClass ( m_className ) ; } catch ( final Exception e ) { final String message = ExecuteJava . REZ . getString ( "executejava.find-class.error" , m_className ) ; throw new TaskException ( message , e ) ; } try { final Class [ ] params = new Class [ ] { args . getClass ( ) } ; final Method main = target . getMethod ( "main" , params ) ; main . invoke ( null , new Object [ ] { args } ) ; } catch ( final InvocationTargetException e ) { final Throwable t = e . getTargetException ( ) ; final String message = ExecuteJava . REZ . getString ( "executejava.execute-app.error" , m_className ) ; throw new TaskException ( message , t ) ; } catch ( final Exception e ) { final String message = ExecuteJava . REZ . getString ( "executejava.execute-app.error" , m_className ) ; throw new TaskException ( message , e ) ; } } public int executeForked ( final TaskContext context ) throws TaskException { } public static String getJavaExecutableName ( ) { } }

Fix:
Class target ;