Program: 37365
Project: 37365
Buggy source:
/** 
 * <pre> query nameserver by nameserver name. URI:/nameserver/{nameserver name} This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. <pre>
 * @param nameserverName represents information regarding DNS name servers used in both forward and reverse DNS. RIRs and some DNRs register or expose nameserver information as an attribute of a domain name, while other DNRs model nameservers as "first class objects".
 * @return JSON formatted result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryNameserver(@PathVariable String nameserverName,HttpServletRequest request){
  nameserverName=queryParser.getLastSplitInURI(request);
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=DomainUtil.geneDomainPunyName(decodeNS);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=StringUtil.getNormalization(decodeNS);
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  LOGGER.debug("String_Node_Str",decodeNS);
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  QueryParam queryParam=queryParser.parseNameserverQueryParam(decodeNS,punyNSName);
  if (queryService.tldInThisRegistry(queryParam)) {
    return queryNsInThisRegistry(queryParam);
  }
  return queryRedirectDomainOrNs(queryParam,nameserverName);
}

Fixed version (ground truth):
/** 
 * <pre> query nameserver by nameserver name. URI:/nameserver/{nameserver name} This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. </pre>
 * @param nameserverName represents information regarding DNS name servers used in both forward and reverse DNS. RIRs and some DNRs register or expose nameserver information as an attribute of a domain name, while other DNRs model nameservers as "first class objects".
 * @param request request.
 * @return JSON formatted result,with HTTP code.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryNameserver(@PathVariable String nameserverName,HttpServletRequest request){
  nameserverName=queryParser.getLastSplitInURI(request);
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=DomainUtil.geneDomainPunyName(decodeNS);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=StringUtil.getNormalization(decodeNS);
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  LOGGER.debug("String_Node_Str",decodeNS);
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  QueryParam queryParam=queryParser.parseNameserverQueryParam(decodeNS,punyNSName);
  if (queryService.tldInThisRegistry(queryParam)) {
    return queryNsInThisRegistry(queryParam);
  }
  return queryRedirectDomainOrNs(queryParam,nameserverName);
}