Program: 188490
Project: 188490
Buggy source:
private Report exportMultiZip(List<AIP> aips,Path outputPath,Report report,ModelService model,IndexService index,StorageService storage,SimpleJobPluginInfo jobPluginInfo){
  for (  AIP aip : aips) {
    LOGGER.debug("String_Node_Str",aip.getId());
    OutputStream os=null;
    String error=null;
    try {
      Path zip=outputPath.resolve(aip.getId() + "String_Node_Str");
      if (Files.exists(zip) && removeIfAlreadyExists) {
        Files.delete(zip);
      }
 else       if (Files.exists(zip) && !removeIfAlreadyExists) {
        error="String_Node_Str" + zip.toString() + "String_Node_Str";
      }
      if (error == null) {
        os=Files.newOutputStream(zip,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING);
        Directory directory=storage.getDirectory(ModelUtils.getAIPStoragePath(aip.getId()));
        ConsumesOutputStream cos=DownloadUtils.download(storage,directory);
        cos.consumeOutputStream(os);
      }
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str" + aip.getId() + "String_Node_Str"+ e.getMessage());
      error=e.getMessage();
    }
 finally {
      if (os != null) {
        IOUtils.closeQuietly(os);
      }
    }
    Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
    if (error != null) {
      reportItem.setPluginState(PluginState.FAILURE).setPluginDetails("String_Node_Str" + error);
      jobPluginInfo.incrementObjectsProcessedWithFailure();
    }
 else {
      reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithSuccess();
    }
    report.addReport(reportItem);
    PluginHelper.updatePartialJobReport(this,model,index,reportItem,true);
  }
  return report;
}

Fixed version (ground truth):
private Report exportMultiZip(List<AIP> aips,Path outputPath,Report report,ModelService model,IndexService index,StorageService storage,SimpleJobPluginInfo jobPluginInfo,Job job){
  for (  AIP aip : aips) {
    LOGGER.debug("String_Node_Str",aip.getId());
    OutputStream os=null;
    String error=null;
    try {
      Path zip=outputPath.resolve(aip.getId() + "String_Node_Str");
      if (Files.exists(zip) && removeIfAlreadyExists) {
        Files.delete(zip);
      }
 else       if (Files.exists(zip) && !removeIfAlreadyExists) {
        error="String_Node_Str" + zip.toString() + "String_Node_Str";
      }
      if (error == null) {
        os=Files.newOutputStream(zip,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING);
        Directory directory=storage.getDirectory(ModelUtils.getAIPStoragePath(aip.getId()));
        ConsumesOutputStream cos=DownloadUtils.download(storage,directory);
        cos.consumeOutputStream(os);
      }
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str" + aip.getId() + "String_Node_Str"+ e.getMessage());
      error=e.getMessage();
    }
 finally {
      if (os != null) {
        IOUtils.closeQuietly(os);
      }
    }
    Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
    if (error != null) {
      reportItem.setPluginState(PluginState.FAILURE).setPluginDetails("String_Node_Str" + error);
      jobPluginInfo.incrementObjectsProcessedWithFailure();
    }
 else {
      reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithSuccess();
    }
    report.addReport(reportItem);
    PluginHelper.updatePartialJobReport(this,model,index,reportItem,true,job);
  }
  return report;
}