Program: 37545
Project: 37545
Buggy source:
/** 
 * search nameserver by name.
 * @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 HttpServletRequest
 * @param response HttpServletResponse
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public ResponseEntity searchNameserver(@RequestParam(required=false) String name,HttpServletRequest request,HttpServletResponse response){
  String decodeNameserver=name;
  String punyNameserver=decodeNameserver;
  try {
    decodeNameserver=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(name);
    punyNameserver=DomainUtil.geneDomainPunyName(decodeNameserver);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeNameserver)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNameserver=StringUtil.getNormalization(decodeNameserver);
  if (StringUtil.ASTERISK.equals(decodeNameserver) || decodeNameserver.startsWith(StringUtil.ASTERISK)) {
    return RestResponseUtil.createResponse422();
  }
  decodeNameserver=DomainUtil.deleteLastPoint(decodeNameserver);
  decodeNameserver=StringUtils.lowerCase(decodeNameserver);
  NameserverSearch nsSearch=searchService.searchNameserver(queryParser.parseNameserverQueryParam(decodeNameserver,punyNameserver));
  if (null != nsSearch) {
    if (nsSearch.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(nsSearch);
    return RestResponseUtil.createResponse200(nsSearch);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * search nameserver by name.
 * @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 HttpServletRequest
 * @param response HttpServletResponse
 * @return JSON formated result,with HTTP code.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody public ResponseEntity searchNameserver(@RequestParam(required=false) String name,HttpServletRequest request,HttpServletResponse response){
  String decodeNameserver=name;
  String punyNameserver=decodeNameserver;
  try {
    decodeNameserver=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(name);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (StringUtils.isBlank(decodeNameserver)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNameserver=StringUtil.getNormalization(decodeNameserver);
  if (StringUtil.ASTERISK.equals(decodeNameserver) || decodeNameserver.startsWith(StringUtil.ASTERISK)) {
    return RestResponseUtil.createResponse422();
  }
  decodeNameserver=DomainUtil.deleteLastPoint(decodeNameserver);
  decodeNameserver=StringUtils.lowerCase(decodeNameserver);
  NameserverSearch nsSearch=searchService.searchNameserver(queryParser.parseNameserverQueryParam(decodeNameserver,punyNameserver));
  if (null != nsSearch) {
    if (nsSearch.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(nsSearch);
    return RestResponseUtil.createResponse200(nsSearch);
  }
  return RestResponseUtil.createResponse404();
}