Program: 8463
Project: 8463
Buggy source:
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,consumes={"String_Node_Str"},produces={"String_Node_Str","String_Node_Str"}) @ResponseBody public ResponseEntity<Resource<?>> updateEntity(RepositoryRestRequest repoRequest,PersistentEntityResource<?> incoming,@PathVariable String id) throws ResourceNotFoundException {
  RepositoryMethodInvoker repoMethodInvoker=repoRequest.getRepositoryMethodInvoker();
  if (null == repoMethodInvoker || !repoMethodInvoker.hasSaveOne() || !repoMethodInvoker.hasFindOne()) {
    throw new NoSuchMethodError();
  }
  Object domainObj=domainClassConverter.convert(id,STRING_TYPE,TypeDescriptor.valueOf(repoRequest.getPersistentEntity().getType()));
  if (null == domainObj) {
    BeanWrapper incomingWrapper=BeanWrapper.create(incoming.getContent(),conversionService);
    PersistentProperty idProp=incoming.getPersistentEntity().getIdProperty();
    incomingWrapper.setProperty(idProp,conversionService.convert(id,idProp.getType()));
    return createNewEntity(repoRequest,incoming);
  }
  domainObjectMerger.merge(incoming.getContent(),domainObj);
  applicationContext.publishEvent(new BeforeSaveEvent(incoming.getContent()));
  Object obj=repoMethodInvoker.save(domainObj);
  applicationContext.publishEvent(new AfterSaveEvent(obj));
  if (config.isReturnBodyOnUpdate()) {
    PersistentEntityResource per=PersistentEntityResource.wrap(repoRequest.getPersistentEntity(),obj,repoRequest.getBaseUri());
    BeanWrapper wrapper=BeanWrapper.create(obj,conversionService);
    Link selfLink=entityLinks.linkForSingleResource(repoRequest.getPersistentEntity().getType(),wrapper.getProperty(repoRequest.getPersistentEntity().getIdProperty())).withSelfRel();
    per.add(selfLink);
    return resourceResponse(null,per,HttpStatus.OK);
  }
 else {
    return resourceResponse(null,null,HttpStatus.NO_CONTENT);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT,consumes={"String_Node_Str"},produces={"String_Node_Str","String_Node_Str"}) @ResponseBody @Transactional public ResponseEntity<Resource<?>> updateEntity(RepositoryRestRequest repoRequest,PersistentEntityResource<?> incoming,@PathVariable String id) throws ResourceNotFoundException {
  RepositoryMethodInvoker repoMethodInvoker=repoRequest.getRepositoryMethodInvoker();
  if (null == repoMethodInvoker || !repoMethodInvoker.hasSaveOne() || !repoMethodInvoker.hasFindOne()) {
    throw new NoSuchMethodError();
  }
  Object domainObj=domainClassConverter.convert(id,STRING_TYPE,TypeDescriptor.valueOf(repoRequest.getPersistentEntity().getType()));
  if (null == domainObj) {
    BeanWrapper incomingWrapper=BeanWrapper.create(incoming.getContent(),conversionService);
    PersistentProperty idProp=incoming.getPersistentEntity().getIdProperty();
    incomingWrapper.setProperty(idProp,conversionService.convert(id,idProp.getType()));
    return createNewEntity(repoRequest,incoming);
  }
  domainObjectMerger.merge(incoming.getContent(),domainObj);
  applicationContext.publishEvent(new BeforeSaveEvent(incoming.getContent()));
  Object obj=repoMethodInvoker.save(domainObj);
  applicationContext.publishEvent(new AfterSaveEvent(obj));
  if (config.isReturnBodyOnUpdate()) {
    PersistentEntityResource per=PersistentEntityResource.wrap(repoRequest.getPersistentEntity(),obj,repoRequest.getBaseUri());
    BeanWrapper wrapper=BeanWrapper.create(obj,conversionService);
    Link selfLink=entityLinks.linkForSingleResource(repoRequest.getPersistentEntity().getType(),wrapper.getProperty(repoRequest.getPersistentEntity().getIdProperty())).withSelfRel();
    per.add(selfLink);
    return resourceResponse(null,per,HttpStatus.OK);
  }
 else {
    return resourceResponse(null,null,HttpStatus.NO_CONTENT);
  }
}