Buggy code:
public class Jar extends Zip { private static final String INDEX_NAME = "META-INF//INDEX.LIST" ; private static final String MANIFEST_NAME = "META-INF//MANIFEST.MF" ; private List serviceList = new ArrayList ( ) ; private Manifest configuredManifest ; private Manifest savedConfiguredManifest ; private Manifest filesetManifest ; private Manifest originalManifest ; private Jar . FilesetManifestConfig filesetManifestConfig ; private boolean mergeManifestsMain = true ; private Manifest manifest ; private String manifestEncoding ; private File manifestFile ; private boolean index = false ; private boolean createEmpty = false ; private Vector rootEntries ; private Path indexJars ; private static final ZipExtraField [ ] JAR_MARKER = new ZipExtraField [ ] { JarMarker . getInstance ( ) } ; protected String emptyBehavior = "create" ; public Jar ( ) { } public void setWhenempty ( WhenEmpty we ) { } public void setWhenmanifestonly ( WhenEmpty we ) { } public void setJarfile ( File jarFile ) { } public void setIndex ( boolean flag ) { } public void setManifestEncoding ( String manifestEncoding ) { } public void addConfiguredManifest ( Manifest newManifest ) throws ManifestException { } public void setManifest ( File manifestFile ) { } private Manifest getManifest ( File manifestFile ) { } private Manifest getManifestFromJar ( File jarFile ) throws IOException { } private Manifest getManifest ( Reader r ) { } public void setFilesetmanifest ( Jar . FilesetManifestConfig config ) { } public void addMetainf ( ZipFileSet fs ) { } public void addConfiguredIndexJars ( Path p ) { } public void addConfiguredService ( Service service ) { } private void writeServices ( ZipOutputStream zOut ) throws IOException { Iterator serviceIterator ; Service service ; serviceIterator = serviceList . iterator ( ) ; while ( serviceIterator . hasNext ( ) ) { service = ( ( Service ) ( serviceIterator . next ( ) ) ) ; <START_BUG> super . zipFile ( service . getAsStream ( ) , zOut , ( "META-INF//service//" + ( service . getType ( ) ) ) , System . currentTimeMillis ( ) , null , DEFAULT_FILE_MODE ) ; <END_BUG> } } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } private Manifest createManifest ( ) throws BuildException { } private void writeManifest ( ZipOutputStream zOut , Manifest manifest ) throws IOException { } protected void finalizeZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } private void createIndexList ( ZipOutputStream zOut ) throws IOException { } protected void zipFile ( InputStream is , ZipOutputStream zOut , String vPath , long lastModified , File fromArchive , int mode ) throws IOException { } private void filesetManifest ( File file , InputStream is ) throws IOException { } protected ArchiveState getResourcesToAdd ( ResourceCollection [ ] rcs , File zipFile , boolean needsUpdate ) throws BuildException { } protected boolean createEmptyZip ( File zipFile ) throws BuildException { } protected void cleanUp ( ) { } public void reset ( ) { } public static class FilesetManifestConfig extends EnumeratedAttribute { public String [ ] getValues ( ) { } } protected final void writeIndexLikeList ( List dirs , List files , PrintWriter writer ) throws IOException { } protected static final String findJarName ( String fileName , String [ ] classpath ) { } protected static final void grabFilesAndDirs ( String file , List dirs , List files ) throws IOException { } }

Fix:
super . zipFile ( service . getAsStream ( ) , zOut , ( "META-INF//services//" + ( service . getType ( ) ) ) , System . currentTimeMillis ( ) , null , DEFAULT_FILE_MODE ) ;