Program: 8496
Project: 8496
Buggy source:
/** 
 * Create a new entity by reading the incoming data and calling   {@link CrudRepository#save(Object)} and letting theID be auto-generated. <p/> To get the entity back in the body of the response, simpy add the URL parameter <pre>returnBody=true</pre>.
 * @param request
 * @param uriBuilder
 * @param repository
 * @return
 * @throws IOException
 */
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public ResponseEntity<?> create(ServletServerHttpRequest request,UriComponentsBuilder uriBuilder,@PathVariable String repository) throws IOException {
  URI baseUri=uriBuilder.build().toUri();
  RepositoryMetadata repoMeta=repositoryMetadataFor(repository);
  if (!repoMeta.exportsMethod(CrudMethod.SAVE_ONE)) {
    return negotiateResponse(request,HttpStatus.METHOD_NOT_ALLOWED,new HttpHeaders(),null);
  }
  CrudRepository repo=repoMeta.repository();
  MediaType incomingMediaType=request.getHeaders().getContentType();
  Object incoming=readIncoming(request,incomingMediaType,repoMeta.entityMetadata().type());
  if (null == incoming) {
    throw new HttpMessageNotReadableException("String_Node_Str" + repoMeta.entityMetadata().type().getSimpleName() + "String_Node_Str");
  }
  publishEvent(new BeforeSaveEvent(incoming));
  Object savedEntity=repo.save(incoming);
  publishEvent(new AfterSaveEvent(savedEntity));
  String sId=repoMeta.entityMetadata().idAttribute().get(savedEntity).toString();
  URI selfUri=buildUri(baseUri,repository,sId);
  HttpHeaders headers=new HttpHeaders();
  headers.set(LOCATION,selfUri.toString());
  Resource<?> body=null;
  if (returnBody(request)) {
    MapResource resource=createResource(repoMeta.rel(),savedEntity,repoMeta.entityMetadata(),buildUri(baseUri,repository,sId));
    resource.addLink(new SimpleLink(SELF,selfUri));
    body=resource;
  }
  publishEvent(new BeforeRenderResourceEvent(request,repoMeta,body));
  return negotiateResponse(request,HttpStatus.CREATED,headers,body);
}

Fixed version (ground truth):
/** 
 * Create a new entity by reading the incoming data and calling   {@link CrudRepository#save(Object)} and letting theID be auto-generated. <p/> To get the entity back in the body of the response, simpy add the URL parameter <pre>returnBody=true</pre>.
 * @param request
 * @param uriBuilder
 * @param repository
 * @return
 * @throws IOException
 */
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public ResponseEntity<?> create(ServletServerHttpRequest request,UriComponentsBuilder uriBuilder,@PathVariable String repository) throws IOException {
  URI baseUri=uriBuilder.build().toUri();
  RepositoryMetadata repoMeta=repositoryMetadataFor(repository);
  if (!repoMeta.exportsMethod(CrudMethod.SAVE_ONE)) {
    return negotiateResponse(request,HttpStatus.METHOD_NOT_ALLOWED,new HttpHeaders(),null);
  }
  CrudRepository repo=repoMeta.repository();
  MediaType incomingMediaType=request.getHeaders().getContentType();
  Object incoming=readIncoming(request,incomingMediaType,repoMeta.entityMetadata().type());
  if (null == incoming) {
    throw new HttpMessageNotReadableException("String_Node_Str" + repoMeta.entityMetadata().type().getSimpleName() + "String_Node_Str");
  }
  publishEvent(new BeforeSaveEvent(incoming));
  Object savedEntity=repo.save(incoming);
  publishEvent(new AfterSaveEvent(savedEntity));
  String sId=repoMeta.entityMetadata().idAttribute().get(savedEntity).toString();
  URI selfUri=buildUri(baseUri,repository,sId);
  HttpHeaders headers=new HttpHeaders();
  headers.set(LOCATION,selfUri.toString());
  Resource<?> body=null;
  if (returnBody(request)) {
    MapResource resource=createResource(repoMeta.rel(),savedEntity,repoMeta.entityMetadata(),selfUri);
    resource.addLink(new SimpleLink(SELF,selfUri));
    publishEvent(new BeforeRenderResourceEvent(request,repoMeta,body));
    body=resource;
  }
  return negotiateResponse(request,HttpStatus.CREATED,headers,body);
}