Program: 188749
Project: 188749
Buggy source:
private Report executeOnFile(IndexService index,ModelService model,StorageService storage,List<File> list) throws PluginException {
  int pluginResultState=1;
  Set<String> aipSet=new HashSet<String>();
  boolean notify=true;
  String newRepresentationID=null;
  String newFileId=null;
  ArrayList<File> newFiles=new ArrayList<File>();
  String detailExtension="String_Node_Str";
  Report report=PluginHelper.createPluginReport(this);
  Report reportItem=null;
  for (  File file : list) {
    try {
      LOGGER.debug("String_Node_Str" + file.getId());
      newRepresentationID=UUID.randomUUID().toString();
      reportItem=PluginHelper.createPluginReportItem(this,file.getId(),null);
      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);
        List<String> applicableTo=getApplicableTo();
        List<String> convertableTo=getConvertableTo();
        Map<String,List<String>> pronomToExtension=getPronomToExtension();
        Map<String,List<String>> mimetypeToExtension=getMimetypeToExtension();
        if (doPluginExecute(fileFormat,filePronom,fileMimetype,applicableTo,convertableTo,pronomToExtension,mimetypeToExtension)) {
          fileFormat=getNewFileFormat(fileFormat,filePronom,fileMimetype,applicableTo,pronomToExtension,mimetypeToExtension);
          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.getRepresentationStoragePath(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);
            newFileId=file.getId().replaceFirst("String_Node_Str","String_Node_Str" + outputFormat);
            model.deleteFile(file.getAipId(),newRepresentationID,file.getPath(),file.getId(),notify);
            File f=model.createFile(file.getAipId(),newRepresentationID,file.getPath(),newFileId,payload,notify);
            newFiles.add(f);
            aipSet.add(file.getAipId());
            reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails(result);
          }
 catch (          CommandException e) {
            detailExtension+=file.getId() + "String_Node_Str" + e.getOutput();
            pluginResultState=2;
            reportItem.setPluginState(PluginState.PARTIAL_SUCCESS).setPluginDetails(e.getMessage());
            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());
          }
        }
      }
    }
 catch (    RuntimeException|NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException|ValidationException|IOException|AlreadyExistsException e) {
      LOGGER.error("String_Node_Str" + file.getId() + "String_Node_Str"+ e.getMessage(),e);
      pluginResultState=0;
      reportItem.setPluginState(PluginState.FAILURE).setPluginDetails(e.getMessage());
    }
    boolean notifyEvent=false;
    createEvent(Arrays.asList(file),newFiles,file.getAipId(),newRepresentationID,model,outputFormat,pluginResultState,detailExtension,notifyEvent);
    report.addReport(reportItem);
  }
  try {
    AbstractConvertPluginUtils.reIndexPlugins(model,aipSet);
  }
 catch (  Throwable e) {
    LOGGER.debug("String_Node_Str");
  }
  return report;
}

Fixed version (ground truth):
private Report executeOnFile(IndexService index,ModelService model,StorageService storage,List<File> list) throws PluginException {
  PluginState pluginResultState=PluginState.SUCCESS;
  Set<String> aipSet=new HashSet<String>();
  boolean notify=true;
  String newRepresentationID=null;
  String newFileId=null;
  ArrayList<File> newFiles=new ArrayList<File>();
  String detailExtension="String_Node_Str";
  Report report=PluginHelper.createPluginReport(this);
  Report reportItem=null;
  for (  File file : list) {
    try {
      LOGGER.debug("String_Node_Str" + file.getId());
      newRepresentationID=UUID.randomUUID().toString();
      reportItem=PluginHelper.createPluginReportItem(this,file.getId(),null);
      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);
        List<String> applicableTo=getApplicableTo();
        List<String> convertableTo=getConvertableTo();
        Map<String,List<String>> pronomToExtension=getPronomToExtension();
        Map<String,List<String>> mimetypeToExtension=getMimetypeToExtension();
        if (doPluginExecute(fileFormat,filePronom,fileMimetype,applicableTo,convertableTo,pronomToExtension,mimetypeToExtension)) {
          fileFormat=getNewFileFormat(fileFormat,filePronom,fileMimetype,applicableTo,pronomToExtension,mimetypeToExtension);
          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.getRepresentationStoragePath(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);
            newFileId=file.getId().replaceFirst("String_Node_Str","String_Node_Str" + outputFormat);
            model.deleteFile(file.getAipId(),newRepresentationID,file.getPath(),file.getId(),notify);
            File f=model.createFile(file.getAipId(),newRepresentationID,file.getPath(),newFileId,payload,notify);
            newFiles.add(f);
            aipSet.add(file.getAipId());
            reportItem.setPluginState(PluginState.SUCCESS).setPluginDetails(result);
          }
 catch (          CommandException e) {
            detailExtension+=file.getId() + "String_Node_Str" + e.getOutput();
            pluginResultState=PluginState.PARTIAL_SUCCESS;
            reportItem.setPluginState(PluginState.PARTIAL_SUCCESS).setPluginDetails(e.getMessage());
            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());
          }
        }
      }
    }
 catch (    RuntimeException|NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException|ValidationException|IOException|AlreadyExistsException e) {
      LOGGER.error("String_Node_Str" + file.getId() + "String_Node_Str"+ e.getMessage(),e);
      pluginResultState=PluginState.FAILURE;
      reportItem.setPluginState(PluginState.FAILURE).setPluginDetails(e.getMessage());
    }
    boolean notifyEvent=false;
    createEvent(Arrays.asList(file),newFiles,file.getAipId(),newRepresentationID,model,outputFormat,pluginResultState,detailExtension,notifyEvent);
    report.addReport(reportItem);
  }
  try {
    AbstractConvertPluginUtils.reIndexPlugins(model,aipSet);
  }
 catch (  Throwable e) {
    LOGGER.debug("String_Node_Str");
  }
  return report;
}