Program: 188746
Project: 188746
Buggy source:
private void createEvent(List<File> alteredFiles,List<File> newFiles,String aipId,String newRepresentationID,ModelService model,String outputFormat,int pluginResultState,String detailExtension,boolean notify) throws PluginException {
  List<LinkingIdentifier> premisSourceFilesIdentifiers=new ArrayList<LinkingIdentifier>();
  List<LinkingIdentifier> premisTargetFilesIdentifiers=new ArrayList<LinkingIdentifier>();
  PluginState outcome=PluginState.SUCCESS;
  StringBuilder stringBuilder=new StringBuilder();
  if (alteredFiles.size() == 0) {
    stringBuilder.append("String_Node_Str");
  }
 else {
    for (    File file : alteredFiles) {
      premisSourceFilesIdentifiers.add(PluginHelper.getLinkingIdentifier(aipId,file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_SOURCE));
    }
    for (    File file : newFiles) {
      premisTargetFilesIdentifiers.add(PluginHelper.getLinkingIdentifier(aipId,file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_OUTCOME));
    }
    stringBuilder.append("String_Node_Str" + outputFormat + "String_Node_Str");
  }
  if (pluginResultState == 0 || (pluginResultState == 2 && hasPartialSuccessOnOutcome() == false)) {
    outcome=PluginState.FAILURE;
    stringBuilder.setLength(0);
  }
  if (pluginResultState == 2 && hasPartialSuccessOnOutcome() == true) {
    outcome=PluginState.PARTIAL_SUCCESS;
  }
  try {
    PluginHelper.createPluginEvent(this,aipId,model,premisSourceFilesIdentifiers,premisTargetFilesIdentifiers,outcome,stringBuilder.toString(),notify);
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
    throw new PluginException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void createEvent(List<File> alteredFiles,List<File> newFiles,String aipId,String newRepresentationID,ModelService model,String outputFormat,PluginState outcome,String detailExtension,boolean notify) throws PluginException {
  List<LinkingIdentifier> premisSourceFilesIdentifiers=new ArrayList<LinkingIdentifier>();
  List<LinkingIdentifier> premisTargetFilesIdentifiers=new ArrayList<LinkingIdentifier>();
  StringBuilder stringBuilder=new StringBuilder();
  if (alteredFiles.size() == 0) {
    stringBuilder.append("String_Node_Str");
  }
 else {
    for (    File file : alteredFiles) {
      premisSourceFilesIdentifiers.add(PluginHelper.getLinkingIdentifier(aipId,file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_SOURCE));
    }
    for (    File file : newFiles) {
      premisTargetFilesIdentifiers.add(PluginHelper.getLinkingIdentifier(aipId,file.getRepresentationId(),file.getPath(),file.getId(),RodaConstants.PRESERVATION_LINKING_OBJECT_OUTCOME));
    }
    stringBuilder.append("String_Node_Str" + outputFormat + "String_Node_Str");
  }
  if (outcome == PluginState.FAILURE || (outcome == PluginState.PARTIAL_SUCCESS && hasPartialSuccessOnOutcome() == false)) {
    outcome=PluginState.FAILURE;
    stringBuilder.setLength(0);
  }
  try {
    PluginHelper.createPluginEvent(this,aipId,model,premisSourceFilesIdentifiers,premisTargetFilesIdentifiers,outcome,stringBuilder.toString(),notify);
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
    throw new PluginException(e.getMessage(),e);
  }
}