Program: 62394
Project: 62394
Buggy source:
/** 
 * Update application's deployment setup
 * @param appId The application id.
 * @return nothing if success, error will be handled in global exception strategy
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(method=RequestMethod.PUT,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") @Audit public RestResponse<?> updateDeploymentSetup(@PathVariable String appId,@PathVariable String environmentId,@RequestBody UpdateDeploymentTopologyRequest updateRequest) throws OrchestratorDisabledException {
  checkAuthorizations(appId,environmentId);
  DeploymentConfiguration deploymentConfiguration=deploymentTopologyService.getDeploymentConfiguration(environmentId);
  DeploymentTopology deploymentTopology=deploymentConfiguration.getDeploymentTopology();
  ReflectionUtil.mergeObject(updateRequest,deploymentTopology);
  try {
    deploymentTopologyValidationService.checkPropertiesContraints(deploymentTopology);
  }
 catch (  ConstraintViolationException e) {
    return RestResponseBuilder.<ConstraintUtil.ConstraintInformation>builder().data(e.getConstraintInformation()).error(RestErrorBuilder.builder(RestErrorCode.PROPERTY_CONSTRAINT_VIOLATION_ERROR).message(e.getMessage()).build()).build();
  }
catch (  ConstraintValueDoNotMatchPropertyTypeException e) {
    return RestResponseBuilder.<ConstraintUtil.ConstraintInformation>builder().data(e.getConstraintInformation()).error(RestErrorBuilder.builder(RestErrorCode.PROPERTY_TYPE_VIOLATION_ERROR).message(e.getMessage()).build()).build();
  }
  deploymentTopologyService.updateDeploymentTopologyInputsAndSave(deploymentTopology);
  return RestResponseBuilder.<DeploymentTopologyDTO>builder().data(buildDeploymentTopologyDTO(deploymentConfiguration)).build();
}

Fixed version (ground truth):
/** 
 * @param appId The application id
 * @param environmentId Id of the environment we want to update
 * @param updateRequest an {@link UpdateDeploymentTopologyRequest} object
 * @return a {@link RestResponse} with:<br>the  {@link DeploymentTopologyDTO} if everithing went well, the <br>Error if not
 * @throws OrchestratorDisabledException
 */
@ApiOperation(value="String_Node_Str",notes="String_Node_Str") @RequestMapping(method=RequestMethod.PUT,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("String_Node_Str") @Audit public RestResponse<?> updateDeploymentSetup(@PathVariable String appId,@PathVariable String environmentId,@RequestBody UpdateDeploymentTopologyRequest updateRequest) throws OrchestratorDisabledException {
  checkAuthorizations(appId,environmentId);
  DeploymentConfiguration deploymentConfiguration=deploymentTopologyService.getDeploymentConfiguration(environmentId);
  DeploymentTopology deploymentTopology=deploymentConfiguration.getDeploymentTopology();
  ReflectionUtil.mergeObject(updateRequest,deploymentTopology);
  try {
    deploymentTopologyValidationService.checkPropertiesContraints(deploymentTopology);
  }
 catch (  ConstraintViolationException e) {
    return RestResponseBuilder.<ConstraintUtil.ConstraintInformation>builder().data(e.getConstraintInformation()).error(RestErrorBuilder.builder(RestErrorCode.PROPERTY_CONSTRAINT_VIOLATION_ERROR).message(e.getMessage()).build()).build();
  }
catch (  ConstraintValueDoNotMatchPropertyTypeException e) {
    return RestResponseBuilder.<ConstraintUtil.ConstraintInformation>builder().data(e.getConstraintInformation()).error(RestErrorBuilder.builder(RestErrorCode.PROPERTY_TYPE_VIOLATION_ERROR).message(e.getMessage()).build()).build();
  }
  deploymentTopologyService.updateDeploymentTopologyInputsAndSave(deploymentTopology);
  return RestResponseBuilder.<DeploymentTopologyDTO>builder().data(buildDeploymentTopologyDTO(deploymentConfiguration)).build();
}