Program: 8469
Project: 8469
Buggy source:
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(method={RequestMethod.POST,RequestMethod.PUT},consumes={"String_Node_Str","String_Node_Str","String_Node_Str"}) @ResponseBody public ResponseEntity<Resource<?>> createPropertyReference(final RepositoryRestRequest repoRequest,final @RequestBody Resource<Object> incoming,@PathVariable String id,@PathVariable String property) throws ResourceNotFoundException, NoSuchMethodException {
  final RepositoryMethodInvoker repoMethodInvoker=repoRequest.getRepositoryMethodInvoker();
  if (!repoMethodInvoker.hasSaveOne()) {
    throw new NoSuchMethodException();
  }
  Function<ReferencedProperty,Resource<?>> handler=new Function<ReferencedProperty,Resource<?>>(){
    @Override public Resource<?> apply(    ReferencedProperty prop){
      if (prop.property.isCollectionLike()) {
        Collection coll=new ArrayList();
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          coll.addAll((Collection)prop.propertyValue);
        }
        for (        Link l : incoming.getLinks()) {
          Object propVal=loadPropertyValue(prop.propertyType,l.getHref());
          coll.add(propVal);
        }
        prop.wrapper.setProperty(prop.property,coll);
      }
 else       if (prop.property.isMap()) {
        Map m=new HashMap();
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          m.putAll((Map)prop.propertyValue);
        }
        for (        Link l : incoming.getLinks()) {
          Object propVal=loadPropertyValue(prop.propertyType,l.getHref());
          m.put(l.getRel(),propVal);
        }
        prop.wrapper.setProperty(prop.property,m);
      }
 else {
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          throw new IllegalStateException("String_Node_Str");
        }
        if (incoming.getLinks().size() != 1) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        Object propVal=loadPropertyValue(prop.propertyType,incoming.getLinks().get(0).getHref());
        prop.wrapper.setProperty(prop.property,propVal);
      }
      applicationContext.publishEvent(new BeforeLinkSaveEvent(prop.wrapper.getBean(),prop.propertyValue));
      Object result=repoMethodInvoker.save(prop.wrapper.getBean());
      applicationContext.publishEvent(new AfterLinkSaveEvent(result,prop.propertyValue));
      return null;
    }
  }
;
  doWithReferencedProperty(repoRequest,id,property,handler);
  return resourceResponse(null,EMPTY_RESOURCE,HttpStatus.CREATED);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @RequestMapping(method={RequestMethod.POST,RequestMethod.PUT},consumes={"String_Node_Str","String_Node_Str","String_Node_Str"}) @ResponseBody @Transactional public ResponseEntity<Resource<?>> createPropertyReference(final RepositoryRestRequest repoRequest,final @RequestBody Resource<Object> incoming,@PathVariable String id,@PathVariable String property) throws ResourceNotFoundException, NoSuchMethodException {
  final RepositoryMethodInvoker repoMethodInvoker=repoRequest.getRepositoryMethodInvoker();
  if (!repoMethodInvoker.hasSaveOne()) {
    throw new NoSuchMethodException();
  }
  Function<ReferencedProperty,Resource<?>> handler=new Function<ReferencedProperty,Resource<?>>(){
    @Override public Resource<?> apply(    ReferencedProperty prop){
      if (prop.property.isCollectionLike()) {
        Collection coll=new ArrayList();
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          coll.addAll((Collection)prop.propertyValue);
        }
        for (        Link l : incoming.getLinks()) {
          Object propVal=loadPropertyValue(prop.propertyType,l.getHref());
          coll.add(propVal);
        }
        prop.wrapper.setProperty(prop.property,coll);
      }
 else       if (prop.property.isMap()) {
        Map m=new HashMap();
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          m.putAll((Map)prop.propertyValue);
        }
        for (        Link l : incoming.getLinks()) {
          Object propVal=loadPropertyValue(prop.propertyType,l.getHref());
          m.put(l.getRel(),propVal);
        }
        prop.wrapper.setProperty(prop.property,m);
      }
 else {
        if ("String_Node_Str".equals(repoRequest.getRequest().getMethod())) {
          throw new IllegalStateException("String_Node_Str");
        }
        if (incoming.getLinks().size() != 1) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        Object propVal=loadPropertyValue(prop.propertyType,incoming.getLinks().get(0).getHref());
        prop.wrapper.setProperty(prop.property,propVal);
      }
      applicationContext.publishEvent(new BeforeLinkSaveEvent(prop.wrapper.getBean(),prop.propertyValue));
      Object result=repoMethodInvoker.save(prop.wrapper.getBean());
      applicationContext.publishEvent(new AfterLinkSaveEvent(result,prop.propertyValue));
      return null;
    }
  }
;
  doWithReferencedProperty(repoRequest,id,property,handler);
  return resourceResponse(null,EMPTY_RESOURCE,HttpStatus.CREATED);
}