Program: 61280
Project: 61280
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public ResourceTO update(HttpServletResponse response,@RequestBody ResourceTO resourceTO) throws SyncopeClientCompositeErrorException, NotFoundException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  TargetResource resource=null;
  if (resourceTO != null && resourceTO.getName() != null) {
    resource=resourceDAO.find(resourceTO.getName());
  }
  if (resource == null) {
    if (log.isErrorEnabled()) {
      log.error("String_Node_Str");
    }
    throw new NotFoundException(resourceTO.getName());
  }
  ResourceDataBinder binder=new ResourceDataBinder(schemaDAO,connectorInstanceDAO);
  TargetResource actual=null;
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    List<SchemaMapping> mappings=resource.getMappings();
    for (    SchemaMapping mapping : mappings) {
      mapping.setResource(null);
      schemaDAO.removeMapping(mapping.getId());
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    resource=binder.getResource(resource,resourceTO);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + resource.getName());
    }
    actual=resourceDAO.save(resource);
    if (actual == null) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str");
      }
      SyncopeClientException ex=new SyncopeClientException(SyncopeClientExceptionType.Unknown);
      throw ex;
    }
  }
 catch (  SyncopeClientException ex) {
    SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
    compositeErrorException.addException(ex);
    throw compositeErrorException;
  }
catch (  Throwable t) {
    if (log.isErrorEnabled()) {
      log.error("String_Node_Str",t);
    }
    SyncopeClientException ex=new SyncopeClientException(SyncopeClientExceptionType.Unknown);
    SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
    compositeErrorException.addException(ex);
    throw compositeErrorException;
  }
  response.setStatus(HttpServletResponse.SC_CREATED);
  return binder.getResourceTO(actual);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public ResourceTO update(HttpServletResponse response,@RequestBody ResourceTO resourceTO) throws SyncopeClientCompositeErrorException, NotFoundException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  TargetResource resource=null;
  if (resourceTO != null && resourceTO.getName() != null) {
    resource=resourceDAO.find(resourceTO.getName());
  }
  if (resource == null) {
    if (log.isErrorEnabled()) {
      log.error("String_Node_Str");
    }
    throw new NotFoundException(resourceTO.getName());
  }
  ResourceDataBinder binder=new ResourceDataBinder(schemaDAO,connectorInstanceDAO);
  TargetResource actual;
  try {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    List<SchemaMapping> mappings=resource.getMappings();
    for (    SchemaMapping mapping : mappings) {
      mapping.setResource(null);
      schemaDAO.removeMapping(mapping.getId());
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    resource=binder.getResource(resource,resourceTO);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + resource.getName());
    }
    actual=resourceDAO.save(resource);
    if (actual == null) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str");
      }
      SyncopeClientException ex=new SyncopeClientException(SyncopeClientExceptionType.Unknown);
      throw ex;
    }
  }
 catch (  SyncopeClientException ex) {
    SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
    compositeErrorException.addException(ex);
    throw compositeErrorException;
  }
catch (  Throwable t) {
    if (log.isErrorEnabled()) {
      log.error("String_Node_Str",t);
    }
    SyncopeClientException ex=new SyncopeClientException(SyncopeClientExceptionType.Unknown);
    SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
    compositeErrorException.addException(ex);
    throw compositeErrorException;
  }
  response.setStatus(HttpServletResponse.SC_CREATED);
  return binder.getResourceTO(actual);
}