Buggy code:
private boolean updatedFile = false ; private boolean addingNewFiles = false ; private String encoding ; private boolean keepCompression = false ; private boolean roundUp = true ; private String comment = "" ; private int level = ZipOutputStream . DEFAULT_COMPRESSION ; private boolean preserve0Permissions = false ; private boolean useLanguageEncodingFlag = true ; private Zip . UnicodeExtraField createUnicodeExtraFields = Zip . UnicodeExtraField . NEVER ; private boolean fallBackToUTF8 = false ; 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 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 { if ( zf != null ) { ZipEntry ze = zf . getEntry ( r . getName ( ) ) ; if ( ze != null ) { boolean oldCompress = doCompress ; if ( keepCompression ) { doCompress = ( ze . getMethod ( ) ) == ( ZipEntry . DEFLATED ) ; } InputStream is = null ; try { is = zf . getInputStream ( ze ) ; <START_BUG> zipFile ( is , zOut , ( prefix + name ) , ze . getTime ( ) , fromArchive , mode , ze . getExtraFields ( ) ) ; <END_BUG> } finally { doCompress = oldCompress ; FileUtils . close ( is ) ; } } } else { InputStream is = null ; try { is = r . getInputStream ( ) ; zipFile ( is , zOut , ( prefix + name ) , r . getLastModified ( ) , fromArchive , mode , ( r instanceof ZipResource ? ( ( ZipResource ) ( r ) ) . getExtraFields ( ) : null ) ) ; } finally { FileUtils . close ( is ) ; } } } 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 ( ) { }

Fix:
zipFile ( is , zOut , ( prefix + name ) , ze . getTime ( ) , fromArchive , mode , ze . getExtraFields ( true ) ) ;