Program: 188448
Project: 188448
Buggy source:
private void processAIP(IndexService index,ModelService model,StorageService storage,Report report,SimpleJobPluginInfo jobPluginInfo,Job job,AIP aip){
  boolean aipFailed=false;
  List<String> passedFiles=new ArrayList<String>();
  Map<String,Pair<String,String>> failedFiles=new HashMap<>();
  List<LinkingIdentifier> sources=new ArrayList<LinkingIdentifier>();
  for (  Representation r : aip.getRepresentations()) {
    LOGGER.debug("String_Node_Str",r.getId(),aip.getId());
    try {
      boolean recursive=true;
      CloseableIterable<OptionalWithCause<File>> allFiles=model.listFilesUnder(aip.getId(),r.getId(),recursive);
      for (      OptionalWithCause<File> oFile : allFiles) {
        if (oFile.isPresent()) {
          File file=oFile.get();
          if (!file.isDirectory()) {
            StoragePath storagePath=ModelUtils.getFileStoragePath(file);
            Binary currentFileBinary=storage.getBinary(storagePath);
            Binary premisFile=model.retrievePreservationFile(file);
            List<Fixity> fixities=PremisV3Utils.extractFixities(premisFile);
            sources.add(PluginHelper.getLinkingIdentifier(aip.getId(),file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_SOURCE));
            String fileEntry=file.getRepresentationId() + (file.getPath().isEmpty() ? "String_Node_Str" : '/' + String.join("String_Node_Str",file.getPath())) + '/'+ file.getId();
            if (fixities != null) {
              boolean passedFixity=true;
              Set<String> algorithms=new HashSet<>();
              for (              Fixity f : fixities) {
                algorithms.add(f.getMessageDigestAlgorithm());
              }
              try {
                Map<String,String> checksums=FileUtility.checksums(currentFileBinary.getContent().createInputStream(),algorithms);
                for (                Fixity f : fixities) {
                  String checksum=checksums.get(f.getMessageDigestAlgorithm());
                  if (!f.getMessageDigest().trim().equalsIgnoreCase(checksum.trim())) {
                    passedFixity=false;
                    failedFiles.put(fileEntry,new Pair<>(f.getMessageDigest().trim(),checksum.trim()));
                    break;
                  }
                }
              }
 catch (              NoSuchAlgorithmException e) {
                passedFixity=false;
                LOGGER.debug("String_Node_Str",e);
              }
              if (passedFixity) {
                passedFiles.add(fileEntry);
              }
 else {
                aipFailed=true;
                createIncidence(model,file,risks.get(0));
              }
            }
          }
        }
      }
      IOUtils.closeQuietly(allFiles);
    }
 catch (    IOException|RODAException|XmlException e) {
      LOGGER.error("String_Node_Str",r.getId(),e);
    }
  }
  try {
    Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
    if (aipFailed) {
      ValidationReport validationReport=new ValidationReport();
      for (      Entry<String,Pair<String,String>> entry : failedFiles.entrySet()) {
        ValidationIssue issue=new ValidationIssue(entry.getKey() + "String_Node_Str" + entry.getValue().getFirst()+ "String_Node_Str"+ entry.getValue().getSecond()+ "String_Node_Str");
        validationReport.addIssue(issue);
      }
      reportItem.setPluginState(PluginState.FAILURE).setHtmlPluginDetails(true).setPluginDetails(validationReport.toHtml(false,false,false,"String_Node_Str"));
      jobPluginInfo.incrementObjectsProcessedWithFailure();
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,sources,null,PluginState.FAILURE,validationReport.toHtml(false,false,false,"String_Node_Str"),true);
    }
 else {
      reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithSuccess();
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,sources,null,PluginState.SUCCESS,"String_Node_Str",true);
    }
    report.addReport(reportItem);
    PluginHelper.updatePartialJobReport(this,model,index,reportItem,true,job);
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
    LOGGER.error("String_Node_Str");
  }
}

Fixed version (ground truth):
private void processAIP(IndexService index,ModelService model,StorageService storage,Report report,SimpleJobPluginInfo jobPluginInfo,Job job,AIP aip){
  boolean aipFailed=false;
  List<String> passedFiles=new ArrayList<String>();
  List<LinkingIdentifier> sources=new ArrayList<LinkingIdentifier>();
  ValidationReport validationReport=new ValidationReport();
  for (  Representation r : aip.getRepresentations()) {
    LOGGER.debug("String_Node_Str",r.getId(),aip.getId());
    try {
      boolean recursive=true;
      CloseableIterable<OptionalWithCause<File>> allFiles=model.listFilesUnder(aip.getId(),r.getId(),recursive);
      for (      OptionalWithCause<File> oFile : allFiles) {
        if (oFile.isPresent()) {
          File file=oFile.get();
          if (!file.isDirectory()) {
            StoragePath storagePath=ModelUtils.getFileStoragePath(file);
            Binary currentFileBinary=storage.getBinary(storagePath);
            Binary premisFile=model.retrievePreservationFile(file);
            List<Fixity> fixities=PremisV3Utils.extractFixities(premisFile);
            sources.add(PluginHelper.getLinkingIdentifier(aip.getId(),file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_SOURCE));
            String fileEntry=file.getRepresentationId() + (file.getPath().isEmpty() ? "String_Node_Str" : '/' + String.join("String_Node_Str",file.getPath())) + '/'+ file.getId();
            if (fixities != null) {
              boolean passedFixity=true;
              Set<String> algorithms=new HashSet<>();
              for (              Fixity f : fixities) {
                algorithms.add(f.getMessageDigestAlgorithm());
              }
              try {
                Map<String,String> checksums=FileUtility.checksums(currentFileBinary.getContent().createInputStream(),algorithms);
                for (                Fixity f : fixities) {
                  String checksum=checksums.get(f.getMessageDigestAlgorithm());
                  if (!f.getMessageDigest().trim().equalsIgnoreCase(checksum.trim())) {
                    passedFixity=false;
                    ValidationIssue issue=new ValidationIssue(fileEntry + "String_Node_Str" + f.getMessageDigest().trim()+ "String_Node_Str"+ checksum.trim()+ "String_Node_Str");
                    validationReport.addIssue(issue);
                    break;
                  }
                }
              }
 catch (              NoSuchAlgorithmException|IOException e) {
                passedFixity=false;
                ValidationIssue issue=new ValidationIssue("String_Node_Str" + e.getMessage());
                validationReport.addIssue(issue);
                LOGGER.debug("String_Node_Str",e);
              }
              if (passedFixity) {
                passedFiles.add(fileEntry);
              }
 else {
                aipFailed=true;
                createIncidence(model,file,risks.get(0));
              }
            }
          }
        }
      }
      IOUtils.closeQuietly(allFiles);
    }
 catch (    IOException|RODAException|XmlException e) {
      LOGGER.error("String_Node_Str",r.getId(),e);
    }
  }
  try {
    Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
    if (aipFailed) {
      reportItem.setPluginState(PluginState.FAILURE).setHtmlPluginDetails(true).setPluginDetails(validationReport.toHtml(false,false,false,"String_Node_Str"));
      jobPluginInfo.incrementObjectsProcessedWithFailure();
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,sources,null,PluginState.FAILURE,validationReport.toHtml(false,false,false,"String_Node_Str"),true);
    }
 else {
      reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithSuccess();
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,sources,null,PluginState.SUCCESS,"String_Node_Str",true);
    }
    report.addReport(reportItem);
    PluginHelper.updatePartialJobReport(this,model,index,reportItem,true,job);
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
    LOGGER.error("String_Node_Str");
  }
}