Program: 62328
Project: 62328
Buggy source:
/** 
 * Update one property for a given @{IndexedRelationshipType} of a   {@link NodeTemplate}
 * @param topologyId The id of the topology that contains the node template for which to update a property.
 * @param nodeTemplateName The name of the node template for which to update a property.
 * @param updatePropertyRequest The key and value of the property to update. When value is null => "reset" (load the default value).
 * @return a void rest response that contains no data if successful and an error if something goes wrong.
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") public RestResponse<ConstraintInformation> updateRelationshipPropertyValue(@PathVariable String topologyId,@PathVariable String nodeTemplateName,@PathVariable String relationshipName,@RequestBody UpdateIndexedTypePropertyRequest updatePropertyRequest){
  Topology topology=topologyServiceCore.getOrFail(topologyId);
  topologyService.checkEditionAuthorizations(topology);
  topologyService.throwsErrorIfReleased(topology);
  String propertyName=updatePropertyRequest.getPropertyName();
  String propertyValue=updatePropertyRequest.getPropertyValue();
  String relationshipType=updatePropertyRequest.getType();
  Map<String,IndexedRelationshipType> relationshipTypes=topologyServiceCore.getIndexedRelationshipTypesFromTopology(topology);
  if (!relationshipTypes.get(relationshipType).getProperties().containsKey(propertyName)) {
    throw new NotFoundException("String_Node_Str" + propertyName + "String_Node_Str"+ nodeTemplateName+ "String_Node_Str"+ relationshipType+ "String_Node_Str");
  }
  log.debug("String_Node_Str",propertyName,relationshipType,nodeTemplateName,topology.getId(),relationshipTypes.get(relationshipType).getProperties().get(propertyName),propertyValue);
  Map<String,NodeTemplate> nodeTemplates=topologyServiceCore.getNodeTemplates(topology);
  NodeTemplate nodeTemplate=topologyServiceCore.getNodeTemplate(topologyId,nodeTemplateName,nodeTemplates);
  Map<String,RelationshipTemplate> relationships=nodeTemplate.getRelationships();
  try {
    propertyService.setPropertyValue(relationships.get(relationshipName).getProperties(),relationshipTypes.get(relationshipType).getProperties().get(propertyName),propertyName,propertyValue);
  }
 catch (  ConstraintValueDoNotMatchPropertyTypeException|ConstraintViolationException e) {
    return RestConstraintValidator.fromException(e,propertyName,propertyValue);
  }
  topologyServiceCore.save(topology);
  return RestResponseBuilder.<ConstraintInformation>builder().build();
}

Fixed version (ground truth):
/** 
 * Update one property for a given @{IndexedRelationshipType} of a   {@link NodeTemplate}
 * @param topologyId The id of the topology that contains the node template for which to update a property.
 * @param nodeTemplateName The name of the node template for which to update a property.
 * @param updatePropertyRequest The key and value of the property to update. When value is null => "reset" (load the default value).
 * @return a void rest response that contains no data if successful and an error if something goes wrong.
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") public RestResponse<ConstraintInformation> updateRelationshipPropertyValue(@PathVariable String topologyId,@PathVariable String nodeTemplateName,@PathVariable String relationshipName,@RequestBody UpdateIndexedTypePropertyRequest updatePropertyRequest){
  Topology topology=topologyServiceCore.getOrFail(topologyId);
  topologyService.checkEditionAuthorizations(topology);
  topologyService.throwsErrorIfReleased(topology);
  String propertyName=updatePropertyRequest.getPropertyName();
  Object propertyValue=updatePropertyRequest.getPropertyValue();
  String relationshipType=updatePropertyRequest.getType();
  Map<String,IndexedRelationshipType> relationshipTypes=topologyServiceCore.getIndexedRelationshipTypesFromTopology(topology);
  if (!relationshipTypes.get(relationshipType).getProperties().containsKey(propertyName)) {
    throw new NotFoundException("String_Node_Str" + propertyName + "String_Node_Str"+ nodeTemplateName+ "String_Node_Str"+ relationshipType+ "String_Node_Str");
  }
  log.debug("String_Node_Str",propertyName,relationshipType,nodeTemplateName,topology.getId(),relationshipTypes.get(relationshipType).getProperties().get(propertyName),propertyValue);
  Map<String,NodeTemplate> nodeTemplates=topologyServiceCore.getNodeTemplates(topology);
  NodeTemplate nodeTemplate=topologyServiceCore.getNodeTemplate(topologyId,nodeTemplateName,nodeTemplates);
  Map<String,RelationshipTemplate> relationships=nodeTemplate.getRelationships();
  try {
    propertyService.setPropertyValue(relationships.get(relationshipName).getProperties(),relationshipTypes.get(relationshipType).getProperties().get(propertyName),propertyName,propertyValue);
  }
 catch (  ConstraintValueDoNotMatchPropertyTypeException|ConstraintViolationException e) {
    return RestConstraintValidator.fromException(e,propertyName,propertyValue);
  }
  topologyServiceCore.save(topology);
  return RestResponseBuilder.<ConstraintInformation>builder().build();
}