Program: 120281
Project: 120281
Buggy source:
private void doZip1(final File source,final List<File> list) throws Exception {
  int beginIndex=source.getPath().length() + 1;
  org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream out=null;
  java.io.OutputStream output_stream=new java.io.FileOutputStream(targetZip);
  if (isEncrypted && !"String_Node_Str".equals(password)) {
    output_stream=new javax.crypto.CipherOutputStream(output_stream,org.talend.archive.IntegrityUtil.createCipher(javax.crypto.Cipher.ENCRYPT_MODE,password));
  }
  out=new org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream(new java.io.BufferedOutputStream(output_stream));
  out.setLevel(compressLevel);
  out.setEncoding(encoding);
  if ("String_Node_Str".equals(zip64Mode)) {
    out.setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode.Always);
  }
 else   if ("String_Node_Str".equals(zip64Mode)) {
    out.setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode.Never);
  }
  for (int i=0; i < list.size(); i++) {
    java.io.BufferedInputStream in=new java.io.BufferedInputStream(new java.io.FileInputStream(list.get(i)));
    org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry=new org.apache.commons.compress.archivers.zip.ZipArchiveEntry(list.get(i).getPath().substring(beginIndex));
    entry.setTime(list.get(i).lastModified());
    out.putArchiveEntry(entry);
    int readLen;
    byte[] buf=new byte[1024];
    while ((readLen=in.read(buf,0,1024)) != -1) {
      out.write(buf,0,readLen);
    }
    out.closeArchiveEntry();
    out.flush();
    in.close();
  }
  if (out != null) {
    out.close();
  }
}

Fixed version (ground truth):
private void doZip1(final File source,final List<File> list) throws Exception {
  int beginIndex=source.getPath().length() + 1;
  java.io.OutputStream output_stream=null;
  try {
    output_stream=new java.io.FileOutputStream(targetZip);
    if (isEncrypted && !"String_Node_Str".equals(password)) {
      output_stream=new javax.crypto.CipherOutputStream(output_stream,org.talend.archive.IntegrityUtil.createCipher(javax.crypto.Cipher.ENCRYPT_MODE,password));
    }
  }
 catch (  Exception e) {
    if (output_stream != null) {
      output_stream.close();
    }
    throw e;
  }
  org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream out=null;
  out=new org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream(new java.io.BufferedOutputStream(output_stream));
  out.setLevel(compressLevel);
  out.setEncoding(encoding);
  if ("String_Node_Str".equals(zip64Mode)) {
    out.setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode.Always);
  }
 else   if ("String_Node_Str".equals(zip64Mode)) {
    out.setUseZip64(org.apache.commons.compress.archivers.zip.Zip64Mode.Never);
  }
  try {
    for (int i=0; i < list.size(); i++) {
      org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry=new org.apache.commons.compress.archivers.zip.ZipArchiveEntry(list.get(i).getPath().substring(beginIndex));
      entry.setTime(list.get(i).lastModified());
      out.putArchiveEntry(entry);
      java.io.BufferedInputStream in=null;
      try {
        in=new java.io.BufferedInputStream(new java.io.FileInputStream(list.get(i)));
        int readLen;
        byte[] buf=new byte[1024];
        while ((readLen=in.read(buf,0,1024)) != -1) {
          out.write(buf,0,readLen);
        }
      }
  finally {
        if (in != null) {
          in.close();
        }
      }
      out.closeArchiveEntry();
      out.flush();
    }
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}