Program: 188633
Project: 188633
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;
        for (        Representation r : aip.getRepresentations()) {
          LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
          try {
            List<String> passedFiles=new ArrayList<String>();
            List<String> failedFiles=new ArrayList<String>();
            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);
                    }
                    if (passedFixity) {
                      passedFiles.add(file.getId());
                    }
 else {
                      failedFiles.add(file.getId());
                      aipFailed=true;
                      PluginHelper.createRiskIfNotExists(model,0,risks.get(0),getClass());
                      model.addRiskIncidence(risks.get(0),file.getAipId(),file.getRepresentationId(),file.getPath(),file.getId());
                    }
                  }
                }
 else {
                  LOGGER.warn("String_Node_Str",oFile.getCause());
                }
              }
            }
            IOUtils.closeQuietly(allFiles);
            model.notifyAIPUpdated(aip.getId());
          }
 catch (          IOException|RODAException|XmlException e) {
            LOGGER.error("String_Node_Str" + r.getId() + "String_Node_Str"+ e.getMessage(),e);
          }
        }
        try {
          Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
          if (aipFailed) {
            reportItem.setPluginState(PluginState.FAILURE).setPluginDetails("String_Node_Str");
            jobPluginInfo.incrementObjectsProcessedWithFailure();
            PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.FAILURE,"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;
}

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;
        for (        Representation r : aip.getRepresentations()) {
          LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
          try {
            List<String> passedFiles=new ArrayList<String>();
            List<String> failedFiles=new ArrayList<String>();
            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);
                    }
                    if (passedFixity) {
                      passedFiles.add(file.getId());
                    }
 else {
                      failedFiles.add(file.getId());
                      aipFailed=true;
                      PluginHelper.createRiskIfNotExists(model,0,risks.get(0),getClass());
                      model.addRiskIncidence(risks.get(0),file.getAipId(),file.getRepresentationId(),file.getPath(),file.getId());
                    }
                  }
                }
              }
            }
            IOUtils.closeQuietly(allFiles);
            model.notifyAIPUpdated(aip.getId());
          }
 catch (          IOException|RODAException|XmlException e) {
            LOGGER.error("String_Node_Str" + r.getId() + "String_Node_Str"+ e.getMessage(),e);
          }
        }
        try {
          Report reportItem=PluginHelper.initPluginReportItem(this,aip.getId(),AIP.class,AIPState.ACTIVE);
          if (aipFailed) {
            reportItem.setPluginState(PluginState.FAILURE).setPluginDetails("String_Node_Str");
            jobPluginInfo.incrementObjectsProcessedWithFailure();
            PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.FAILURE,"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;
}