Buggy code:
public class Main implements AntMain { public static final String DEFAULT_BUILD_FILENAME = "build.xml" ; private int msgOutputLevel = Project . MSG_INFO ; private File buildFile ; private static PrintStream out = System . out ; private static PrintStream err = System . err ; private Vector targets = new Vector ( ) ; private Properties definedProps = new Properties ( ) ; private Vector listeners = new Vector ( 1 ) ; private Vector propertyFiles = new Vector ( 1 ) ; private boolean allowInput = true ; private boolean keepGoingMode = false ; private String loggerClassname = null ; private String inputHandlerClassname = null ; private boolean emacsMode = false ; private boolean readyToRun = false ; private boolean projectHelp = false ; private static boolean isLogFileUsed = false ; private Integer threadPriority = null ; private static void printMessage ( Throwable t ) { } public static void start ( String [ ] args , Properties additionalUserProperties , ClassLoader coreLoader ) { } public void startAnt ( String [ ] args , Properties additionalUserProperties , ClassLoader coreLoader ) { try { Diagnostics . validateVersion ( ) ; processArgs ( args ) ; } catch ( Throwable exc ) { Main . handleLogfile ( ) ; Main . printMessage ( exc ) ; System . exit ( 1 ) ; } if ( additionalUserProperties != null ) { for ( Enumeration e = additionalUserProperties . keys ( ) ; e . hasMoreElements ( ) ; ) { String key = ( ( String ) ( e . nextElement ( ) ) ) ; String property = additionalUserProperties . getProperty ( key ) ; definedProps . put ( key , property ) ; } } int exitCode = 1 ; try { try { runBuild ( coreLoader ) ; exitCode = 0 ; } catch ( ExitStatusException ese ) { exitCode = ese . getStatus ( ) ; <START_BUG> if ( exitCode > 0 ) { <END_BUG> throw ese ; } } } catch ( BuildException be ) { if ( ( Main . err ) != ( System . err ) ) { Main . printMessage ( be ) ; } } catch ( Throwable exc ) { exc . printStackTrace ( ) ; Main . printMessage ( exc ) ; } finally { Main . handleLogfile ( ) ; } System . exit ( exitCode ) ; } private static void handleLogfile ( ) { } public static void main ( String [ ] args ) { } public Main ( ) { } protected Main ( String [ ] args ) throws BuildException { } private void processArgs ( String [ ] args ) { } private File getParentFile ( File file ) { } private File findBuildFile ( String start , String suffix ) throws BuildException { } private void runBuild ( ClassLoader coreLoader ) throws BuildException { } protected void addBuildListeners ( Project project ) { } private void addInputHandler ( Project project ) throws BuildException { } private BuildLogger createLogger ( ) { } private static void printUsage ( ) { } private static void printVersion ( ) throws BuildException { } private static String antVersion = null ; public static synchronized String getAntVersion ( ) throws BuildException { } private static void printDescription ( Project project ) { } private static void printTargets ( Project project , boolean printSubTargets ) { } private static int findTargetPosition ( Vector names , String name ) { } private static void printTargets ( Project project , Vector names , Vector descriptions , String heading , int maxlen ) { } }

Fix:
if ( exitCode != 0 ) {