Program: 188774
Project: 188774
Buggy source:
private Report executeOnFile(IndexService index,ModelService model,StorageService storage,List<File> list,IndexedPreservationAgent agent) throws PluginException {
  int state=1;
  Set<String> aipSet=new HashSet<String>();
  boolean notify=true;
  for (  File file : list) {
    try {
      logger.debug("String_Node_Str" + file.getId());
      String newRepresentationID=UUID.randomUUID().toString();
      if (!file.isDirectory()) {
        IndexedFile ifile=index.retrieve(IndexedFile.class,IdUtils.getFileId(file));
        String fileMimetype=ifile.getFileFormat().getMimeType();
        String filePronom=ifile.getFileFormat().getPronom();
        String fileFormat=ifile.getId().substring(ifile.getId().lastIndexOf('.') + 1);
        if (((!inputFormat.isEmpty() && fileFormat.equalsIgnoreCase(inputFormat)) || (inputFormat.isEmpty())) && (applicableTo.size() == 0 || (filePronom != null && pronomToExtension.containsKey(filePronom)) || (fileMimetype != null && mimetypeToExtension.containsKey(fileMimetype)) || (applicableTo.contains(fileFormat))) && ifile.getSize() < (maxKbytes * 1024)) {
          if (applicableTo.size() > 0) {
            if (filePronom != null && !filePronom.isEmpty() && !pronomToExtension.get(filePronom).contains(fileFormat)) {
              fileFormat=pronomToExtension.get(filePronom).get(0);
            }
 else             if (fileMimetype != null && !fileMimetype.isEmpty() && !mimetypeToExtension.get(fileMimetype).contains(fileFormat)) {
              fileFormat=mimetypeToExtension.get(fileMimetype).get(0);
            }
          }
          StoragePath fileStoragePath=ModelUtils.getFileStoragePath(file);
          DirectResourceAccess directAccess=storage.getDirectAccess(fileStoragePath);
          logger.debug("String_Node_Str" + fileFormat + "String_Node_Str"+ outputFormat+ "String_Node_Str"+ file.getId());
          Path pluginResult=executePlugin(directAccess.getPath(),fileFormat);
          if (pluginResult != null) {
            ContentPayload payload=new FSPathContentPayload(pluginResult);
            StoragePath storagePath=ModelUtils.getRepresentationPath(file.getAipId(),file.getRepresentationId());
            logger.debug("String_Node_Str" + newRepresentationID + "String_Node_Str"+ file.getAipId());
            boolean original=false;
            model.createRepresentation(file.getAipId(),newRepresentationID,original,model.getStorage(),storagePath);
            StoragePath storagePreservationPath=ModelUtils.getPreservationPath(file.getAipId(),newRepresentationID);
            model.getStorage().createDirectory(storagePreservationPath);
            String newFileId=file.getId().replaceFirst("String_Node_Str","String_Node_Str" + outputFormat);
            model.deleteFile(file.getAipId(),newRepresentationID,file.getPath(),file.getId(),notify);
            model.createFile(file.getAipId(),newRepresentationID,file.getPath(),newFileId,payload,notify);
            aipSet.add(file.getAipId());
          }
 else {
            logger.debug("String_Node_Str" + fileFormat + "String_Node_Str"+ outputFormat+ "String_Node_Str"+ file.getId()+ "String_Node_Str"+ file.getRepresentationId()+ "String_Node_Str"+ file.getAipId());
            state=2;
          }
        }
      }
    }
 catch (    Throwable e) {
      logger.error("String_Node_Str" + file.getId() + "String_Node_Str"+ e.getMessage(),e);
      state=0;
    }
  }
  try {
    Plugin<AIP> psp=new PremisSkeletonPlugin();
    Plugin<AIP> sfp=new SiegfriedPlugin();
    Plugin<AIP> ttp=new TikaFullTextPlugin();
    Map<String,String> params=new HashMap<String,String>();
    params.put("String_Node_Str","String_Node_Str");
    psp.setParameterValues(params);
    sfp.setParameterValues(params);
    ttp.setParameterValues(params);
    PluginOrchestrator pluginOrchestrator=new AkkaEmbeddedPluginOrchestrator();
    pluginOrchestrator.runPluginOnAIPs(psp,new ArrayList<String>(aipSet));
    pluginOrchestrator.runPluginOnAIPs(sfp,new ArrayList<String>(aipSet));
    pluginOrchestrator.runPluginOnAIPs(ttp,new ArrayList<String>(aipSet));
    for (    String aipId : aipSet) {
      model.notifyAIPUpdated(aipId);
    }
  }
 catch (  Throwable e) {
    logger.debug("String_Node_Str");
  }
  return new Report();
}

Fixed version (ground truth):
private Report executeOnFile(IndexService index,ModelService model,StorageService storage,List<File> list,IndexedPreservationAgent agent) throws PluginException {
  int state=1;
  Set<String> aipSet=new HashSet<String>();
  boolean notify=true;
  for (  File file : list) {
    try {
      LOGGER.debug("String_Node_Str" + file.getId());
      String newRepresentationID=UUID.randomUUID().toString();
      if (!file.isDirectory()) {
        IndexedFile ifile=index.retrieve(IndexedFile.class,IdUtils.getFileId(file));
        String fileMimetype=ifile.getFileFormat().getMimeType();
        String filePronom=ifile.getFileFormat().getPronom();
        String fileFormat=ifile.getId().substring(ifile.getId().lastIndexOf('.') + 1);
        if (((!inputFormat.isEmpty() && fileFormat.equalsIgnoreCase(inputFormat)) || (inputFormat.isEmpty())) && (getApplicableTo().size() == 0 || (filePronom != null && getPronomToExtension().containsKey(filePronom)) || (fileMimetype != null && getMimetypeToExtension().containsKey(fileMimetype)) || (getApplicableTo().contains(fileFormat)))) {
          if (getApplicableTo().size() > 0) {
            if (filePronom != null && !filePronom.isEmpty() && !getPronomToExtension().get(filePronom).contains(fileFormat)) {
              fileFormat=getPronomToExtension().get(filePronom).get(0);
            }
 else             if (fileMimetype != null && !fileMimetype.isEmpty() && !getMimetypeToExtension().get(fileMimetype).contains(fileFormat)) {
              fileFormat=getMimetypeToExtension().get(fileMimetype).get(0);
            }
          }
          StoragePath fileStoragePath=ModelUtils.getFileStoragePath(file);
          DirectResourceAccess directAccess=storage.getDirectAccess(fileStoragePath);
          LOGGER.debug("String_Node_Str" + fileFormat + "String_Node_Str"+ outputFormat+ "String_Node_Str"+ file.getId());
          try {
            Path pluginResult=Files.createTempFile("String_Node_Str","String_Node_Str" + getOutputFormat());
            String result=executePlugin(directAccess.getPath(),pluginResult,fileFormat);
            ContentPayload payload=new FSPathContentPayload(pluginResult);
            StoragePath storagePath=ModelUtils.getRepresentationPath(file.getAipId(),file.getRepresentationId());
            LOGGER.debug("String_Node_Str" + newRepresentationID + "String_Node_Str"+ file.getAipId());
            boolean original=false;
            model.createRepresentation(file.getAipId(),newRepresentationID,original,model.getStorage(),storagePath);
            StoragePath storagePreservationPath=ModelUtils.getPreservationPath(file.getAipId(),newRepresentationID);
            model.getStorage().createDirectory(storagePreservationPath);
            String newFileId=file.getId().replaceFirst("String_Node_Str","String_Node_Str" + outputFormat);
            model.deleteFile(file.getAipId(),newRepresentationID,file.getPath(),file.getId(),notify);
            model.createFile(file.getAipId(),newRepresentationID,file.getPath(),newFileId,payload,notify);
            aipSet.add(file.getAipId());
          }
 catch (          CommandException e) {
            e.getOutput();
            e.getExitCode();
            LOGGER.debug("String_Node_Str" + fileFormat + "String_Node_Str"+ outputFormat+ "String_Node_Str"+ file.getId()+ "String_Node_Str"+ file.getRepresentationId()+ "String_Node_Str"+ file.getAipId());
            state=2;
          }
        }
      }
    }
 catch (    Throwable e) {
      LOGGER.error("String_Node_Str" + file.getId() + "String_Node_Str"+ e.getMessage(),e);
      state=0;
    }
  }
  try {
    AbstractConvertPluginUtils.reIndexPlugins(model,aipSet);
  }
 catch (  Throwable e) {
    LOGGER.debug("String_Node_Str");
  }
  return new Report();
}