Program: 37381
Project: 37381
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){
  name=queryParser.getParameter(request,"String_Node_Str");
  String decodeDomain=name;
  try {
    decodeDomain=DomainUtil.iso8859Decode(name);
    decodeDomain=DomainUtil.decodeAndReplaceAsciiToLowercase(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=StringUtil.getNormalization(decodeDomain);
  if (!StringUtil.checkIsValidSearchPattern(decodeDomain)) {
    return RestResponseUtil.createResponse422();
  }
  if (!DomainUtil.validateSearchStringIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=StringUtils.lowerCase(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.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public ResponseEntity searchDomain(@RequestParam(required=false) String name,HttpServletRequest request,HttpServletResponse response){
  name=queryParser.getParameter(request,"String_Node_Str");
  String decodeDomain=name;
  try {
    decodeDomain=DomainUtil.iso8859Decode(name);
    decodeDomain=DomainUtil.decodeAndReplaceAsciiToLowercase(decodeDomain);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=StringUtil.getNormalization(decodeDomain);
  if (!StringUtil.checkIsValidSearchPattern(decodeDomain)) {
    return RestResponseUtil.createResponse422();
  }
  if (!DomainUtil.validateSearchStringIsValidIdna(decodeDomain)) {
    return RestResponseUtil.createResponse400();
  }
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  decodeDomain=StringUtils.lowerCase(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();
}