Program: 37261
Project: 37261
Buggy source:
/** 
 * <pre> search domain by domain name. URI:/domains?name={domain name} This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. </pre>
 * @param name is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @param request quest for httpServlet.
 * @param response response for httpServlet.
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public ResponseEntity searchDomain(@RequestParam(required=false) String name,HttpServletRequest request,HttpServletResponse response) throws DecodeException {
  String lastSpliInURI=queryParser.getLastSplitInURI(request);
  if (!"String_Node_Str".equals(lastSpliInURI)) {
    return RestResponseUtil.createResponse400();
  }
  name=queryParser.getParameter(request,"String_Node_Str");
  String decodeDomain=name;
  try {
    decodeDomain=DomainUtil.iso8859Decode(name);
    decodeDomain=DomainUtil.urlDecode(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  if (!StringUtil.checkIsValidSearchPattern(decodeDomain)) {
    return RestResponseUtil.createResponse422();
  }
  if (!DomainUtil.validateSearchStringIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=StringUtil.foldCaseAndNormalization(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  DomainSearch domainSearch=searchService.searchDomain(queryParser.parseDomainQueryParam(decodeDomain,decodeDomain));
  if (null != domainSearch) {
    if (domainSearch.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(domainSearch);
    return RestResponseUtil.createResponse200(domainSearch);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * <pre> search domain by domain name. URI:/domains?name={domain name} This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. </pre>
 * @param name is a fully-qualified (relative to the root) domain name [RFC1594] in either the in-addr.arpa or ip6.arpa zones (for RIRs) or a fully-qualified domain name in a zone administered by the server operator (for DNRs).
 * @param request quest for httpServlet.
 * @param response response for httpServlet.
 * @return JSON formated result,with HTTP code.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public ResponseEntity searchDomain(@RequestParam(required=false) String name,HttpServletRequest request,HttpServletResponse response) throws DecodeException {
  String lastSpliInURI=queryParser.getLastSplitInURI(request);
  if (!"String_Node_Str".equals(lastSpliInURI)) {
    return RestResponseUtil.createResponse400();
  }
  name=queryParser.getParameter(request,"String_Node_Str");
  String decodeDomain=name;
  try {
    decodeDomain=DomainUtil.iso8859Decode(name);
    decodeDomain=DomainUtil.urlDecode(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  if (!StringUtil.checkIsValidSearchPattern(decodeDomain)) {
    return RestResponseUtil.createResponse422();
  }
  if (!DomainUtil.validateSearchStringIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=StringUtil.foldCaseAndNormalization(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  DomainSearch domainSearch=searchService.searchDomain(queryParser.parseDomainQueryParam(decodeDomain,decodeDomain));
  if (null != domainSearch) {
    if (domainSearch.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(domainSearch);
    return RestResponseUtil.createResponse200(domainSearch);
  }
  return RestResponseUtil.createResponse404();
}