Program: 37268
Project: 37268
Buggy source:
/** 
 * <pre> search entity by handle or name. URI:/entities?fn={entity name} ; /entities?handle={handle}. This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. The first appearance parameter 'fn' and 'handle' will be handled, and other parameters will be ignored. Parameter will be trimed. </pre>
 * @param fn fn.
 * @param handle handle.
 * @param request request.
 * @return ResponseEntity.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity searchEntity(@RequestParam(required=false) String fn,@RequestParam(required=false) String handle,HttpServletRequest request) throws DecodeException {
  LOGGER.debug("String_Node_Str",fn,handle);
  String lastSpliInURI=queryParser.getLastSplitInURI(request);
  if (!"String_Node_Str".equals(lastSpliInURI)) {
    return RestResponseUtil.createResponse400();
  }
  final String fnParamName="String_Node_Str";
  final String handleParamName="String_Node_Str";
  String paramName=queryParser.getFirstParameter(request,new String[]{fnParamName,handleParamName});
  if (StringUtils.isBlank(paramName)) {
    return RestResponseUtil.createResponse400();
  }
  String paramValue=queryParser.getParameter(request,paramName);
  paramValue=DomainUtil.iso8859Decode(paramValue);
  if (!StringUtil.isValidEntityHandleOrName(paramValue)) {
    return RestResponseUtil.createResponse400();
  }
  if (!StringUtil.checkIsValidSearchPattern(paramValue)) {
    return RestResponseUtil.createResponse422();
  }
  paramValue=StringUtil.foldCaseAndNormalization(paramValue);
  paramValue=StringUtils.trim(paramValue);
  QueryParam queryParam=queryParser.parseEntityQueryParam(paramValue,paramName);
  LOGGER.debug("String_Node_Str",queryParam);
  EntitySearch result=searchService.searchEntity(queryParam);
  if (null != result) {
    if (result.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(result);
    return RestResponseUtil.createResponse200(result);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * <pre> search entity by handle or name. URI:/entities?fn={entity name} ; /entities?handle={handle}. This service is under permission control, @see AccessControlManager. This service is under policy control, @see PolicyControlService. The first appearance parameter 'fn' and 'handle' will be handled, and other parameters will be ignored. Parameter will be trimed. </pre>
 * @param fn fn.
 * @param handle handle.
 * @param request request.
 * @return ResponseEntity.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity searchEntity(@RequestParam(required=false) String fn,@RequestParam(required=false) String handle,HttpServletRequest request) throws DecodeException {
  LOGGER.debug("String_Node_Str",fn,handle);
  String lastSpliInURI=queryParser.getLastSplitInURI(request);
  if (!"String_Node_Str".equals(lastSpliInURI)) {
    return RestResponseUtil.createResponse400();
  }
  final String fnParamName="String_Node_Str";
  final String handleParamName="String_Node_Str";
  String paramName=queryParser.getFirstParameter(request,new String[]{fnParamName,handleParamName});
  if (StringUtils.isBlank(paramName)) {
    return RestResponseUtil.createResponse400();
  }
  String paramValue=queryParser.getParameter(request,paramName);
  paramValue=DomainUtil.iso8859Decode(paramValue);
  if (!StringUtil.isValidEntityHandleOrName(paramValue)) {
    return RestResponseUtil.createResponse400();
  }
  if (!StringUtil.checkIsValidSearchPattern(paramValue)) {
    return RestResponseUtil.createResponse422();
  }
  paramValue=StringUtil.foldCaseAndNormalization(paramValue);
  paramValue=StringUtils.trim(paramValue);
  QueryParam queryParam=queryParser.parseEntityQueryParam(paramValue,paramName);
  LOGGER.debug("String_Node_Str",queryParam);
  EntitySearch result=searchService.searchEntity(queryParam);
  if (null != result) {
    if (result.getHasNoAuthForAllObjects()) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(result);
    return RestResponseUtil.createResponse200(result);
  }
  return RestResponseUtil.createResponse404();
}