Buggy code:
public class Zip extends MatchingTask { private File zipFile ; private File baseDir ; private boolean doCompress = true ; protected String archiveType = "zip" ; private static long emptyCrc = new CRC32 ( ) . getValue ( ) ; protected String emptyBehavior = "skip" ; private Vector filesets = new Vector ( ) ; private Hashtable addedDirs = new Hashtable ( ) ; public void setZipfile ( File zipFile ) { } public void setBasedir ( String baseDirname ) { } public void setCompress ( String compress ) { } public void addFileset ( FileSet set ) { } public void setWhenempty ( String we ) throws BuildException { } public void execute ( ) throws BuildException { <START_BUG> if ( ( ( baseDir ) == null ) && ( ( filesets . size ( ) ) == 0 ) ) <END_BUG> throw new BuildException ( "basedir<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set,<seq2seq4repair_space>or<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>fileset<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>given!" ) ; Vector dss = new Vector ( ) ; if ( ( baseDir ) != null ) dss . addElement ( getDirectoryScanner ( baseDir ) ) ; for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; dss . addElement ( fs . getDirectoryScanner ( project ) ) ; } FileScanner [ ] scanners = new FileScanner [ dss . size ( ) ] ; dss . copyInto ( scanners ) ; if ( isUpToDate ( scanners , zipFile ) ) return ; log ( ( ( ( "Building<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( zipFile . getAbsolutePath ( ) ) ) ) ; try { ZipOutputStream zOut = new ZipOutputStream ( new FileOutputStream ( zipFile ) ) ; try { if ( doCompress ) { zOut . setMethod ( ZipOutputStream . DEFLATED ) ; } else { zOut . setMethod ( ZipOutputStream . STORED ) ; } initZipOutputStream ( zOut ) ; for ( int j = 0 ; j < ( scanners . length ) ; j ++ ) { addFiles ( scanners [ j ] , zOut , "" ) ; } } finally { zOut . close ( ) ; } } catch ( IOException ioe ) { String msg = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( archiveType ) ) + ":<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; if ( ! ( zipFile . delete ( ) ) ) { msg += "<seq2seq4repair_space>(and<seq2seq4repair_space>the<seq2seq4repair_space>archive<seq2seq4repair_space>is<seq2seq4repair_space>probably<seq2seq4repair_space>corrupt<seq2seq4repair_space>but<seq2seq4repair_space>I<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>delete<seq2seq4repair_space>it)" ; } throw new BuildException ( msg , ioe , location ) ; } } protected void addFiles ( FileScanner scanner , ZipOutputStream zOut , String prefix ) throws IOException { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected boolean isUpToDate ( FileScanner [ ] scanners , File zipFile ) throws BuildException { } protected static File [ ] grabFiles ( FileScanner [ ] scanners ) { } protected void zipDir ( File dir , ZipOutputStream zOut , String vPath ) throws IOException { } protected void zipFile ( InputStream in , ZipOutputStream zOut , String vPath , long lastModified ) throws IOException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } protected void addParentDirs ( File baseDir , String entry , ZipOutputStream zOut , String prefix ) throws IOException { } }

Fix:
if ( ( ( ( baseDir ) == null ) && ( ( filesets . size ( ) ) == 0 ) ) && ( "zip" . equals ( archiveType ) ) )