Program: 188492
Project: 188492
Buggy source:
private Report exportFolders(List<AIP> aips,Path outputPath,StorageService storage,ModelService model,IndexService index,Report report,SimpleJobPluginInfo jobPluginInfo){
  try {
    FileStorageService localStorage=new FileStorageService(Paths.get(outputFolder));
    for (    AIP aip : aips) {
      LOGGER.debug("String_Node_Str",aip.getId());
      String error=null;
      StoragePath aipPath=ModelUtils.getAIPStoragePath(aip.getId());
      try {
        localStorage.copy(storage,aipPath,DefaultStoragePath.parse(aip.getId()));
      }
 catch (      AlreadyExistsException e) {
        if (removeIfAlreadyExists) {
          try {
            localStorage.deleteResource(DefaultStoragePath.parse(aip.getId()));
            localStorage.copy(storage,aipPath,DefaultStoragePath.parse(aip.getId()));
          }
 catch (          AlreadyExistsException e2) {
            error="String_Node_Str" + aipPath.toString();
          }
        }
 else {
          error="String_Node_Str" + aipPath.toString() + "String_Node_Str";
        }
      }
      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);
      try {
        boolean notify=true;
        PluginHelper.createPluginEvent(this,aip.getId(),model,index,reportItem.getPluginState(),"String_Node_Str",notify);
      }
 catch (      ValidationException|RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|AlreadyExistsException e) {
        LOGGER.error("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException|NotFoundException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return report;
}

Fixed version (ground truth):
private Report exportFolders(List<AIP> aips,Path outputPath,StorageService storage,ModelService model,IndexService index,Report report,SimpleJobPluginInfo jobPluginInfo,Job job){
  try {
    FileStorageService localStorage=new FileStorageService(Paths.get(outputFolder));
    for (    AIP aip : aips) {
      LOGGER.debug("String_Node_Str",aip.getId());
      String error=null;
      StoragePath aipPath=ModelUtils.getAIPStoragePath(aip.getId());
      try {
        localStorage.copy(storage,aipPath,DefaultStoragePath.parse(aip.getId()));
      }
 catch (      AlreadyExistsException e) {
        if (removeIfAlreadyExists) {
          try {
            localStorage.deleteResource(DefaultStoragePath.parse(aip.getId()));
            localStorage.copy(storage,aipPath,DefaultStoragePath.parse(aip.getId()));
          }
 catch (          AlreadyExistsException e2) {
            error="String_Node_Str" + aipPath.toString();
          }
        }
 else {
          error="String_Node_Str" + aipPath.toString() + "String_Node_Str";
        }
      }
      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);
      try {
        boolean notify=true;
        PluginHelper.createPluginEvent(this,aip.getId(),model,index,reportItem.getPluginState(),"String_Node_Str",notify);
      }
 catch (      ValidationException|RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|AlreadyExistsException e) {
        LOGGER.error("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException|NotFoundException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return report;
}