Program: 188579
Project: 188579
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<AIP> list) throws PluginException {
  Report report=PluginHelper.initPluginReport(this);
  try {
    SimpleJobPluginInfo jobPluginInfo=PluginHelper.getInitialJobInformation(this,list.size());
    PluginHelper.updateJobInformation(this,jobPluginInfo);
    try {
      for (      AIP aip : list) {
        boolean aipFailed=false;
        List<String> passedFiles=new ArrayList<String>();
        List<String> failedFiles=new ArrayList<String>();
        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);
                  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;
                          break;
                        }
                      }
                    }
 catch (                    NoSuchAlgorithmException e) {
                      passedFixity=false;
                      LOGGER.debug("String_Node_Str",e);
                    }
                    String fileEntry=file.getRepresentationId() + (file.getPath().isEmpty() ? "String_Node_Str" : '/' + String.join("String_Node_Str",file.getPath())) + '/'+ file.getId();
                    if (passedFixity) {
                      passedFiles.add(fileEntry);
                    }
 else {
                      failedFiles.add(fileEntry);
                      aipFailed=true;
                      createRiskAndIncidence(model,file,risks.get(0));
                    }
                  }
                }
              }
            }
            IOUtils.closeQuietly(allFiles);
            model.notifyAIPUpdated(aip.getId());
          }
 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).setPluginDetails("String_Node_Str" + failedFiles);
            jobPluginInfo.incrementObjectsProcessedWithFailure();
            PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.FAILURE,"String_Node_Str" + failedFiles.toString(),true);
          }
 else {
            reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails("String_Node_Str");
            jobPluginInfo.incrementObjectsProcessedWithSuccess();
            PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.SUCCESS,"String_Node_Str",true);
          }
          report.addReport(reportItem);
          PluginHelper.updatePartialJobReport(this,model,index,reportItem,true);
        }
 catch (        RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
          LOGGER.error("String_Node_Str");
        }
      }
    }
 catch (    ClassCastException e) {
      LOGGER.error("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithFailure(list.size());
    }
    jobPluginInfo.finalizeInfo();
    PluginHelper.updateJobInformation(this,jobPluginInfo);
  }
 catch (  JobException e) {
    LOGGER.error("String_Node_Str");
  }
  return report;
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<AIP> list) throws PluginException {
  Report report=PluginHelper.initPluginReport(this);
  try {
    SimpleJobPluginInfo jobPluginInfo=PluginHelper.getInitialJobInformation(this,list.size());
    PluginHelper.updateJobInformation(this,jobPluginInfo);
    try {
      for (      AIP aip : list) {
        boolean aipFailed=false;
        List<String> passedFiles=new ArrayList<String>();
        Map<String,Pair<String,String>> failedFiles=new HashMap<>();
        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);
                  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);
            model.notifyAIPUpdated(aip.getId());
          }
 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,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,PluginState.SUCCESS,"String_Node_Str",true);
          }
          report.addReport(reportItem);
          PluginHelper.updatePartialJobReport(this,model,index,reportItem,true);
        }
 catch (        RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
          LOGGER.error("String_Node_Str");
        }
      }
    }
 catch (    ClassCastException e) {
      LOGGER.error("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithFailure(list.size());
    }
    jobPluginInfo.finalizeInfo();
    PluginHelper.updateJobInformation(this,jobPluginInfo);
  }
 catch (  JobException e) {
    LOGGER.error("String_Node_Str");
  }
  return report;
}