Program: 188676
Project: 188676
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<AIP> list) throws PluginException {
  for (  AIP aip : list) {
    for (    Representation r : aip.getRepresentations()) {
      boolean inotify=false;
      LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
      try {
        boolean recursive=true;
        CloseableIterable<OptionalWithCause<File>> allFiles=model.listFilesUnder(aip.getId(),r.getId(),recursive);
        List<String> okFileIDS=new ArrayList<String>();
        List<String> koFileIDS=new ArrayList<String>();
        for (        OptionalWithCause<File> oFile : allFiles) {
          if (oFile.isPresent()) {
            File file=oFile.get();
            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 fixityOK=true;
              for (              Fixity f : fixities) {
                try {
                  Fixity currentFixity=PremisV3Utils.calculateFixity(currentFileBinary,f.getMessageDigestAlgorithm(),"String_Node_Str");
                  if (!f.getMessageDigest().trim().equalsIgnoreCase(currentFixity.getMessageDigest().trim())) {
                    fixityOK=false;
                    break;
                  }
                }
 catch (                NoSuchAlgorithmException nsae) {
                  fixityOK=false;
                  break;
                }
              }
              if (fixityOK) {
                okFileIDS.add(file.getId());
              }
 else {
                koFileIDS.add(file.getId());
              }
            }
            if (koFileIDS.size() > 0) {
              LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
              StringBuilder sb=new StringBuilder();
              sb.append("String_Node_Str");
              sb.append("String_Node_Str");
              for (              String s : koFileIDS) {
                sb.append("String_Node_Str" + s + "String_Node_Str");
              }
              sb.append("String_Node_Str");
            }
 else {
            }
          }
 else {
            LOGGER.error("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);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<AIP> list) throws PluginException {
  for (  AIP aip : list) {
    for (    Representation r : aip.getRepresentations()) {
      boolean inotify=false;
      LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
      try {
        boolean recursive=true;
        CloseableIterable<OptionalWithCause<File>> allFiles=model.listFilesUnder(aip.getId(),r.getId(),recursive);
        List<String> okFileIDS=new ArrayList<String>();
        List<String> koFileIDS=new ArrayList<String>();
        for (        OptionalWithCause<File> oFile : allFiles) {
          if (oFile.isPresent()) {
            File file=oFile.get();
            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 fixityOK=true;
              for (              Fixity f : fixities) {
                try {
                  Fixity currentFixity=PremisV3Utils.calculateFixity(currentFileBinary,f.getMessageDigestAlgorithm(),"String_Node_Str");
                  if (!f.getMessageDigest().trim().equalsIgnoreCase(currentFixity.getMessageDigest().trim())) {
                    fixityOK=false;
                    break;
                  }
                }
 catch (                NoSuchAlgorithmException nsae) {
                  fixityOK=false;
                  break;
                }
              }
              if (fixityOK) {
                okFileIDS.add(file.getId());
              }
 else {
                koFileIDS.add(file.getId());
                if (riskId != null && !riskId.equals("String_Node_Str")) {
                  try {
                    model.retrieveRisk(riskId);
                  }
 catch (                  NotFoundException e) {
                    Risk risk=new Risk();
                    risk.setName(riskName);
                    risk.setCategory(riskCategory);
                    model.createRisk(risk,riskId,false);
                  }
                  model.addRiskIncidence(riskId,file.getAipId(),file.getRepresentationId(),file.getPath(),file.getId(),"String_Node_Str");
                }
              }
            }
            if (koFileIDS.size() > 0) {
              LOGGER.debug("String_Node_Str" + r.getId() + "String_Node_Str"+ aip.getId());
              StringBuilder sb=new StringBuilder();
              sb.append("String_Node_Str");
              sb.append("String_Node_Str");
              for (              String s : koFileIDS) {
                sb.append("String_Node_Str" + s + "String_Node_Str");
              }
              sb.append("String_Node_Str");
            }
 else {
            }
          }
 else {
            LOGGER.error("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);
      }
    }
  }
  return null;
}