Program: 189274
Project: 189274
Buggy source:
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse createFieldProfile(@ApiVariable String workflowStepId,@Data String data) throws NumberFormatException, WorkflowStepNonOverrideableException, JsonProcessingException {
  JsonNode dataNode=null;
  try {
    dataNode=objectMapper.readTree(data);
  }
 catch (  IOException e) {
    return new ApiResponse(ERROR,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
  Long reqOrgId=Long.parseLong(dataNode.get("String_Node_Str").toString());
  FieldGloss gloss=objectMapper.treeToValue(dataNode.get("String_Node_Str"),FieldGloss.class);
  ControlledVocabulary controlledVocabulary=dataNode.get("String_Node_Str") != null ? objectMapper.treeToValue(dataNode.get("String_Node_Str"),ControlledVocabulary.class) : null;
  FieldPredicate predicate=objectMapper.treeToValue(dataNode.get("String_Node_Str"),FieldPredicate.class);
  InputType inputType=objectMapper.treeToValue(dataNode.get("String_Node_Str"),InputType.class);
  Boolean repeatable=dataNode.get("String_Node_Str") != null ? Boolean.parseBoolean(dataNode.get("String_Node_Str").toString()) : false;
  String help=dataNode.get("String_Node_Str") != null ? dataNode.get("String_Node_Str").textValue() : null;
  String usage="String_Node_Str";
  WorkflowStep workflowStep=workflowStepRepo.findOne(Long.parseLong(workflowStepId));
  FieldProfile createdProfile=fieldProfileRepo.create(workflowStep,predicate,inputType,usage,help,repeatable,true,true,true);
  createdProfile.addControlledVocabulary(controlledVocabulary);
  createdProfile.addFieldGloss(gloss);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,organizationRepo.findOne(reqOrgId)));
  return new ApiResponse(SUCCESS,fieldProfileRepo.save(createdProfile));
}

Fixed version (ground truth):
@ApiMapping("String_Node_Str") @Auth(role="String_Node_Str") public ApiResponse createFieldProfile(@ApiVariable String workflowStepId,@Data String data) throws NumberFormatException, WorkflowStepNonOverrideableException, JsonProcessingException {
  JsonNode dataNode=null;
  try {
    dataNode=objectMapper.readTree(data);
  }
 catch (  IOException e) {
    return new ApiResponse(ERROR,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
  Long reqOrgId=Long.parseLong(dataNode.get("String_Node_Str").toString());
  FieldGloss gloss=objectMapper.treeToValue(dataNode.get("String_Node_Str"),FieldGloss.class);
  ControlledVocabulary controlledVocabulary=dataNode.get("String_Node_Str") != null ? objectMapper.treeToValue(dataNode.get("String_Node_Str"),ControlledVocabulary.class) : null;
  FieldPredicate predicate=objectMapper.treeToValue(dataNode.get("String_Node_Str"),FieldPredicate.class);
  InputType inputType=objectMapper.treeToValue(dataNode.get("String_Node_Str"),InputType.class);
  Boolean repeatable=dataNode.get("String_Node_Str") != null ? Boolean.parseBoolean(dataNode.get("String_Node_Str").toString()) : false;
  String help=dataNode.get("String_Node_Str") != null ? dataNode.get("String_Node_Str").textValue() : null;
  String usage=dataNode.get("String_Node_Str") != null ? dataNode.get("String_Node_Str").textValue() : "String_Node_Str";
  WorkflowStep workflowStep=workflowStepRepo.findOne(Long.parseLong(workflowStepId));
  Organization requestingOrganization=organizationRepo.findOne(reqOrgId);
  if (!requestingOrganization.getId().equals(workflowStep.getOriginatingOrganization().getId())) {
    workflowStep=workflowStepRepo.update(workflowStep,requestingOrganization);
  }
  FieldProfile createdProfile=fieldProfileRepo.create(workflowStep,predicate,inputType,usage,help,repeatable,true,true,true);
  createdProfile.addControlledVocabulary(controlledVocabulary);
  createdProfile.addFieldGloss(gloss);
  simpMessagingTemplate.convertAndSend("String_Node_Str",new ApiResponse(SUCCESS,organizationRepo.findOne(reqOrgId)));
  return new ApiResponse(SUCCESS,fieldProfileRepo.save(createdProfile));
}