Buggy code:
public class Zip extends MatchingTask { protected File zipFile ; private ZipScanner zs ; private File baseDir ; protected Hashtable entries = new Hashtable ( ) ; private Vector groupfilesets = new Vector ( ) ; private Vector filesetsFromGroupfilesets = new Vector ( ) ; protected String duplicate = "add" ; private boolean doCompress = true ; private boolean doUpdate = false ; private boolean savedDoUpdate = false ; private boolean doFilesonly = false ; protected String archiveType = "zip" ; private static final long EMPTY_CRC = new CRC32 ( ) . getValue ( ) ; protected String emptyBehavior = "skip" ; private Vector resources = new Vector ( ) ; protected Hashtable addedDirs = new Hashtable ( ) ; private Vector addedFiles = new Vector ( ) ; protected boolean doubleFilePass = false ; protected boolean skipWriting = false ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private boolean addingNewFiles = false ; private String encoding ; private boolean keepCompression = false ; private boolean roundUp = true ; private String comment = "" ; private int level = ZipOutputStream . DEFAULT_COMPRESSION ; public void setZipfile ( File zipFile ) { } public void setFile ( File file ) { } public void setDestFile ( File destFile ) { } public File getDestFile ( ) { } public void setBasedir ( File baseDir ) { } public void setCompress ( boolean c ) { } public boolean isCompress ( ) { } public void setFilesonly ( boolean f ) { } public void setUpdate ( boolean c ) { } public boolean isInUpdateMode ( ) { } public void addFileset ( FileSet set ) { } public void addZipfileset ( ZipFileSet set ) { } public void add ( ResourceCollection a ) { } public void addZipGroupFileset ( FileSet set ) { } public void setDuplicate ( Zip . Duplicate df ) { } public static class WhenEmpty extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setWhenempty ( Zip . WhenEmpty we ) { } public void setEncoding ( String encoding ) { } public String getEncoding ( ) { } public void setKeepCompression ( boolean keep ) { } public void setComment ( String comment ) { } public String getComment ( ) { } public void setLevel ( int level ) { } public int getLevel ( ) { } public void setRoundUp ( boolean r ) { } public void execute ( ) throws BuildException { } public void executeMain ( ) throws BuildException { <START_BUG> if ( ( ( ( ( baseDir ) == null ) & ( ( resources . size ( ) ) == 0 ) ) && ( ( groupfilesets . size ( ) ) == 0 ) ) && ( "zip" . equals ( archiveType ) ) ) { <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>" + "resource<seq2seq4repair_space>collection<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>given!" ) ) ) ; } if ( ( zipFile ) == null ) { throw new BuildException ( ( ( "You<seq2seq4repair_space>must<seq2seq4repair_space>specify<seq2seq4repair_space>the<seq2seq4repair_space>" + ( archiveType ) ) + "<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>create!" ) ) ; } if ( ( zipFile . exists ( ) ) && ( ! ( zipFile . isFile ( ) ) ) ) { throw new BuildException ( ( ( zipFile ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>file." ) ) ; } if ( ( zipFile . exists ( ) ) && ( ! ( zipFile . canWrite ( ) ) ) ) { throw new BuildException ( ( ( zipFile ) + "<seq2seq4repair_space>is<seq2seq4repair_space>read-only." ) ) ; } File renamedFile = null ; addingNewFiles = true ; if ( ( doUpdate ) && ( ! ( zipFile . exists ( ) ) ) ) { doUpdate = false ; log ( ( ( "ignoring<seq2seq4repair_space>update<seq2seq4repair_space>attribute<seq2seq4repair_space>as<seq2seq4repair_space>" + ( archiveType ) ) + "<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist." ) , MSG_DEBUG ) ; } for ( int i = 0 ; i < ( groupfilesets . size ( ) ) ; i ++ ) { log ( "Processing<seq2seq4repair_space>groupfileset<seq2seq4repair_space>" , MSG_VERBOSE ) ; FileSet fs = ( ( FileSet ) ( groupfilesets . elementAt ( i ) ) ) ; FileScanner scanner = fs . getDirectoryScanner ( getProject ( ) ) ; String [ ] files = scanner . getIncludedFiles ( ) ; File basedir = scanner . getBasedir ( ) ; for ( int j = 0 ; j < ( files . length ) ; j ++ ) { log ( ( ( "Adding<seq2seq4repair_space>file<seq2seq4repair_space>" + ( files [ j ] ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>fileset" ) , MSG_VERBOSE ) ; ZipFileSet zf = new ZipFileSet ( ) ; zf . setProject ( getProject ( ) ) ; zf . setSrc ( new File ( basedir , files [ j ] ) ) ; add ( zf ) ; filesetsFromGroupfilesets . addElement ( zf ) ; } } Vector vfss = new Vector ( ) ; if ( ( baseDir ) != null ) { FileSet fs = ( ( FileSet ) ( getImplicitFileSet ( ) . clone ( ) ) ) ; fs . setDir ( baseDir ) ; vfss . addElement ( fs ) ; } for ( int i = 0 ; i < ( resources . size ( ) ) ; i ++ ) { ResourceCollection rc = ( ( ResourceCollection ) ( resources . elementAt ( i ) ) ) ; vfss . addElement ( rc ) ; } ResourceCollection [ ] fss = new ResourceCollection [ vfss . size ( ) ] ; vfss . copyInto ( fss ) ; boolean success = false ; try { Zip . ArchiveState state = getResourcesToAdd ( fss , zipFile , false ) ; if ( ! ( state . isOutOfDate ( ) ) ) { return ; } if ( ( ! ( zipFile . exists ( ) ) ) && ( state . isWithoutAnyResources ( ) ) ) { createEmptyZip ( zipFile ) ; return ; }

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