Buggy code:
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 setPreserve0Permissions ( boolean b ) { } public boolean getPreserve0Permissions ( ) { } public void setUseLanguageEncodingFlag ( boolean b ) { } public boolean getUseLanguageEnodingFlag ( ) { } public void setCreateUnicodeExtraFields ( Zip . UnicodeExtraField b ) { } public Zip . UnicodeExtraField getCreateUnicodeExtraFields ( ) { } public void setFallBackToUTF8 ( boolean b ) { } public boolean getFallBackToUTF8 ( ) { } public void execute ( ) throws BuildException { } protected boolean hasUpdatedFile ( ) { } public void executeMain ( ) throws BuildException { } private File renameFile ( ) { } private void closeZout ( ZipOutputStream zOut , boolean success ) throws IOException { } private void checkAttributesAndElements ( ) { } private void processDoUpdate ( ) { } private void processGroupFilesets ( ) { } protected final boolean isAddingNewFiles ( ) { } protected final void addResources ( FileSet fileset , Resource [ ] resources , ZipOutputStream zOut ) throws IOException { } private void addDirectoryResource ( Resource r , String name , String prefix , File base , ZipOutputStream zOut , int defaultDirMode , int thisDirMode ) throws IOException { } private int getUnixMode ( Resource r , ZipFile zf , int defaultMode ) throws IOException { } private void addResource ( Resource r , String name , String prefix , ZipOutputStream zOut , int mode , ZipFile zf , File fromArchive ) throws IOException { } protected final void addResources ( ResourceCollection rc , Resource [ ] resources , ZipOutputStream zOut ) throws IOException { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void finalizeZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected boolean createEmptyZip ( File zipFile ) throws BuildException { } private synchronized ZipScanner getZipScanner ( ) { } protected Zip . ArchiveState getResourcesToAdd ( ResourceCollection [ ] rcs , File zipFile , boolean needsUpdate ) throws BuildException { } protected Zip . ArchiveState getResourcesToAdd ( FileSet [ ] filesets , File zipFile , boolean needsUpdate ) throws BuildException { } protected Zip . ArchiveState getNonFileSetResourcesToAdd ( ResourceCollection [ ] rcs , File zipFile , boolean needsUpdate ) throws BuildException { } private Resource [ ] selectOutOfDateResources ( Resource [ ] initial , FileNameMapper mapper ) { } protected Resource [ ] [ ] grabResources ( FileSet [ ] filesets ) { } protected Resource [ ] [ ] grabNonFileSetResources ( ResourceCollection [ ] rcs ) { } protected void zipDir ( File dir , ZipOutputStream zOut , String vPath , int mode ) throws IOException { } protected void zipDir ( File dir , ZipOutputStream zOut , String vPath , int mode , ZipExtraField [ ] extra ) throws IOException { } protected void zipDir ( Resource dir , ZipOutputStream zOut , String vPath , int mode , ZipExtraField [ ] extra ) throws IOException { } private static ThreadLocal currentZipExtra = new ThreadLocal ( ) { protected Object initialValue ( ) { } } ; protected final ZipExtraField [ ] getCurrentExtraFields ( ) { } protected final void setCurrentExtraFields ( ZipExtraField [ ] extra ) { } protected void zipFile ( InputStream in , ZipOutputStream zOut , String vPath , long lastModified , File fromArchive , int mode ) throws IOException { <START_BUG> if ( entries . contains ( vPath ) ) { <END_BUG> if ( duplicate . equals ( "preserve" ) ) { logWhenWriting ( ( vPath + "<seq2seq4repair_space>already<seq2seq4repair_space>added,<seq2seq4repair_space>skipping" ) , MSG_INFO ) ; return ; } else if ( duplicate . equals ( "fail" ) ) { throw new BuildException ( ( ( ( "Duplicate<seq2seq4repair_space>file<seq2seq4repair_space>" + vPath ) + "<seq2seq4repair_space>was<seq2seq4repair_space>found<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>duplicate<seq2seq4repair_space>" ) + "attribute<seq2seq4repair_space>is<seq2seq4repair_space>'fail'." ) ) ; } else { logWhenWriting ( ( ( "duplicate<seq2seq4repair_space>file<seq2seq4repair_space>" + vPath ) + "<seq2seq4repair_space>found,<seq2seq4repair_space>adding." ) , MSG_VERBOSE ) ; } } else { logWhenWriting ( ( "adding<seq2seq4repair_space>entry<seq2seq4repair_space>" + vPath ) , MSG_VERBOSE ) ; } entries . put ( vPath , vPath ) ; if ( ! ( skipWriting ) ) { ZipEntry ze = new ZipEntry ( vPath ) ; ze . setTime ( lastModified ) ; ze . setMethod ( ( doCompress ? ZipEntry . DEFLATED : ZipEntry . STORED ) ) ; if ( ( ! ( zOut . isSeekable ( ) ) ) && ( ! ( doCompress ) ) ) { long size = 0 ; CRC32 cal = new CRC32 ( ) ; if ( ! ( in . markSupported ( ) ) ) { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; byte [ ] buffer = new byte [ Zip . BUFFER_SIZE ] ; int count = 0 ; do { size += count ; cal . update ( buffer , 0 , count ) ; bos . write ( buffer , 0 , count ) ; count = in . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; in = new ByteArrayInputStream ( bos . toByteArray ( ) ) ; } else { in . mark ( Integer . MAX_VALUE ) ;

Fix:
if ( entries . containsKey ( vPath ) ) {