Program: 8513
Project: 8513
Buggy source:
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method={RequestMethod.PUT,RequestMethod.POST},consumes={"String_Node_Str"},produces={"String_Node_Str"}) public void createOrUpdate(ServerHttpRequest request,UriComponentsBuilder uriBuilder,@PathVariable String repository,@PathVariable String id,Model model){
  URI baseUri=uriBuilder.build().toUri();
  CrudRepository repo=repositoryMetadata.repositoryFor(repository);
  if (null == repo) {
    model.addAttribute(STATUS,HttpStatus.NOT_IMPLEMENTED);
    return;
  }
  final TypeMetaCacheEntry typeMeta=typeMetaEntry(repo);
  Serializable serId=stringToSerializable(id,typeMeta.idType);
  Object entity=null;
switch (request.getMethod()) {
case POST:
    try {
      entity=typeMeta.domainClass.newInstance();
    }
 catch (    InstantiationException e) {
      model.addAttribute(STATUS,HttpStatus.INTERNAL_SERVER_ERROR);
      LOG.error(e.getMessage(),e);
      return;
    }
catch (    IllegalAccessException e) {
      model.addAttribute(STATUS,HttpStatus.INTERNAL_SERVER_ERROR);
      LOG.error(e.getMessage(),e);
      return;
    }
  break;
case PUT:
entity=repo.findOne(serId);
break;
}
if (null == entity) {
model.addAttribute(STATUS,HttpStatus.NOT_FOUND);
}
 else {
final MediaType incomingMediaType=request.getHeaders().getContentType();
try {
if (request.getMethod() == HttpMethod.POST) {
final Object incoming=readIncoming(request,incomingMediaType,typeMeta.domainClass);
if (null == incoming) {
  model.addAttribute(STATUS,HttpStatus.BAD_REQUEST);
}
 else {
  typeMeta.entityMetadata.id(serId,incoming);
  Object savedEntity=repo.save(entity);
  String savedId=typeMeta.entityInfo.getId(savedEntity).toString();
  URI selfUri=buildUri(baseUri,repository,savedId);
  HttpHeaders headers=new HttpHeaders();
  headers.set(LOCATION,selfUri.toString());
  model.addAttribute(HEADERS,headers);
  model.addAttribute(STATUS,HttpStatus.CREATED);
}
}
 else {
final Map incoming=readIncoming(request,incomingMediaType,Map.class);
if (null == incoming) {
  model.addAttribute(STATUS,HttpStatus.BAD_REQUEST);
}
 else {
  for (  Map.Entry<String,Attribute> entry : typeMeta.entityMetadata.embeddedAttributes().entrySet()) {
    String name=entry.getKey();
    if (incoming.containsKey(name)) {
      typeMeta.entityMetadata.set(name,incoming.get(name),entity);
    }
  }
  repo.save(entity);
  model.addAttribute(STATUS,HttpStatus.NO_CONTENT);
}
}
}
 catch (IOException e) {
model.addAttribute(STATUS,HttpStatus.BAD_REQUEST);
LOG.error(e.getMessage(),e);
}
}
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method={RequestMethod.PUT,RequestMethod.POST},consumes={"String_Node_Str"},produces={"String_Node_Str"}) public void createOrUpdate(ServerHttpRequest request,UriComponentsBuilder uriBuilder,@PathVariable String repository,@PathVariable String id,Model model){
  URI baseUri=uriBuilder.build().toUri();
  CrudRepository repo=repositoryMetadata.repositoryFor(repository);
  if (null == repo) {
    model.addAttribute(STATUS,HttpStatus.NOT_IMPLEMENTED);
    return;
  }
  final TypeMetaCacheEntry typeMeta=typeMetaEntry(repo);
  Serializable serId=stringToSerializable(id,typeMeta.idType);
  Object entity=null;
switch (request.getMethod()) {
case POST:
    try {
      entity=typeMeta.domainClass.newInstance();
    }
 catch (    InstantiationException e) {
      model.addAttribute(STATUS,HttpStatus.INTERNAL_SERVER_ERROR);
      LOG.error(e.getMessage(),e);
      return;
    }
catch (    IllegalAccessException e) {
      model.addAttribute(STATUS,HttpStatus.INTERNAL_SERVER_ERROR);
      LOG.error(e.getMessage(),e);
      return;
    }
  break;
case PUT:
entity=repo.findOne(serId);
break;
}
if (null == entity) {
model.addAttribute(STATUS,HttpStatus.NOT_FOUND);
}
 else {
final MediaType incomingMediaType=request.getHeaders().getContentType();
try {
final Object incoming=readIncoming(request,incomingMediaType,typeMeta.domainClass);
if (null == incoming) {
model.addAttribute(STATUS,HttpStatus.BAD_REQUEST);
}
 else {
if (request.getMethod() == HttpMethod.POST) {
  typeMeta.entityMetadata.id(serId,incoming);
  Object savedEntity=repo.save(entity);
  String savedId=typeMeta.entityInfo.getId(savedEntity).toString();
  URI selfUri=buildUri(baseUri,repository,savedId);
  HttpHeaders headers=new HttpHeaders();
  headers.set(LOCATION,selfUri.toString());
  model.addAttribute(HEADERS,headers);
  model.addAttribute(STATUS,HttpStatus.CREATED);
}
 else {
  for (  Map.Entry<String,Attribute> entry : typeMeta.entityMetadata.embeddedAttributes().entrySet()) {
    String name=entry.getKey();
    Object o=typeMeta.entityMetadata.get(name,incoming);
    if (null != o) {
      typeMeta.entityMetadata.set(name,o,entity);
    }
  }
  repo.save(entity);
  model.addAttribute(STATUS,HttpStatus.NO_CONTENT);
}
}
}
 catch (IOException e) {
model.addAttribute(STATUS,HttpStatus.BAD_REQUEST);
LOG.error(e.getMessage(),e);
}
}
}