Buggy code:
public class Main { 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 ( 5 ) ; private Properties definedProps = new Properties ( ) ; private Vector listeners = new Vector ( 5 ) ; private Vector propertyFiles = new Vector ( 5 ) ; 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 static void printMessage ( Throwable t ) { } public static void start ( String [ ] args , Properties additionalUserProperties , ClassLoader coreLoader ) { } public static void main ( String [ ] args ) { } protected Main ( String [ ] args ) throws BuildException { } private File getParentFile ( File file ) { } private File findBuildFile ( String start , String suffix ) throws BuildException { } private void runBuild ( ClassLoader coreLoader ) throws BuildException { if ( ! ( readyToRun ) ) { return ; } final Project project = new Project ( ) ; project . setCoreLoader ( coreLoader ) ; Throwable error = null ; try { addBuildListeners ( project ) ; addInputHandler ( project ) ; PrintStream err = System . err ; PrintStream out = System . out ; SecurityManager oldsm = null ; if ( ( ! ( JavaEnvUtils . isJavaVersion ( JAVA_1_0 ) ) ) && ( ! ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) ) ) { oldsm = System . getSecurityManager ( ) ; } try { System . setOut ( new PrintStream ( new DemuxOutputStream ( project , false ) ) ) ; System . setErr ( new PrintStream ( new DemuxOutputStream ( project , true ) ) ) ; if ( ! ( projectHelp ) ) { project . fireBuildStarted ( ) ; } project . init ( ) ; project . setUserProperty ( "ant.version" , Main . getAntVersion ( ) ) ; Enumeration e = definedProps . keys ( ) ; while ( e . hasMoreElements ( ) ) { String arg = ( ( String ) ( e . nextElement ( ) ) ) ; String value = ( ( String ) ( definedProps . get ( arg ) ) ) ; project . setUserProperty ( arg , value ) ; } project . setUserProperty ( "ant.file" , buildFile . getAbsolutePath ( ) ) ; ProjectHelper . configureProject ( project , buildFile ) ; if ( projectHelp ) { Main . printDescription ( project ) ; Main . printTargets ( project , ( ( msgOutputLevel ) > ( Project . MSG_INFO ) ) ) ; return ; } <START_BUG> if ( ( targets . size ( ) ) == 0 ) { <END_BUG> targets . addElement ( project . getDefaultTarget ( ) ) ; } project . executeTargets ( targets ) ; } finally { if ( oldsm != null ) { System . setSecurityManager ( oldsm ) ; } System . setOut ( out ) ; System . setErr ( err ) ; } } catch ( RuntimeException exc ) { error = exc ; throw exc ; } catch ( Error err ) { error = err ; throw err ; } finally { if ( ! ( projectHelp ) ) { project . fireBuildFinished ( error ) ; } } } protected void addBuildListeners ( Project project ) { } private void addInputHandler ( Project project ) { } 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 ( ( ( targets . size ( ) ) == 0 ) && ( ( project . getDefaultTarget ( ) ) != null ) ) {