nus-yam/ex-repair huggingface dataset:
Program: 37168
Project: 37168
Buggy source:
/** 
 * query domain (RIR or DNR).
 * @param queryParam QueryParam include punyname.
 * @return domain object.
 */
@Override public Domain query(QueryParam queryParam){
  LOGGER.debug("String_Node_Str" + queryParam);
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  if (domainQueryParam.isRirDomain()) {
    Domain domain=queryArpaWithoutInnerObjects(queryParam);
    queryAndSetInnerObjects(domain);
    LOGGER.debug("String_Node_Str" + domain);
    return domain;
  }
 else {
    Domain domain=queryDomainWithoutInnerObjects(queryParam);
    queryAndSetInnerObjects(domain);
    LOGGER.debug("String_Node_Str" + domain);
    return domain;
  }
}

Fixed version (ground truth):
/** 
 * query domain (RIR or DNR).
 * @param queryParam QueryParam include punyname.
 * @return domain object.
 */
@Override public Domain query(QueryParam queryParam){
  LOGGER.debug("String_Node_Str" + queryParam);
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  if (domainQueryParam.isRirDomain()) {
    Domain domain=queryArpaWithoutInnerObjects(queryParam);
    queryAndSetInnerObjects(domain);
    LOGGER.debug("String_Node_Str" + domain);
    queryDomainStatus(domain);
    return domain;
  }
 else {
    Domain domain=queryDomainWithoutInnerObjects(queryParam);
    queryAndSetInnerObjects(domain);
    LOGGER.debug("String_Node_Str" + domain);
    queryDomainStatus(domain);
    return domain;
  }
}
Program: 37169
Project: 37169
Buggy source:
@Override public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(sql);
  ps.setString(1,punyName);
  return ps;
}

Fixed version (ground truth):
@Override public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(SQL_QUERY_DOMAIN_STATUS);
  ps.setLong(1,domainId);
  return ps;
}
Program: 37170
Project: 37170
Buggy source:
/** 
 * query domain by arpa, without inner objects. <p> different sql for ipv4 and ipv6.
 * @param queryParam query parameter include punyname
 * @return domain the domain object without inner objects
 */
private Domain queryArpaWithoutInnerObjects(QueryParam queryParam){
  final String arpaName=queryParam.getQ();
  final NetworkInBytes network=ArpaUtil.parseArpa(arpaName);
  List<Domain> result=null;
  final int hexCharSize=IpUtil.getHexCharSize(network.getIpVersion());
  String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + SQL_LEFT_JOIN_DOMAIN_STATUS + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  final String finalSql=sql;
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(finalSql);
      ps.setBytes(1,network.getStartAddress());
      ps.setBytes(2,network.getStartAddress());
      ps.setString(3,network.getIpVersion().getName());
      ps.setInt(4,hexCharSize);
      ps.setInt(5,hexCharSize);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}

Fixed version (ground truth):
/** 
 * query domain by arpa, without inner objects. <p> different sql for ipv4 and ipv6.
 * @param queryParam query parameter include punyname
 * @return domain the domain object without inner objects
 */
private Domain queryArpaWithoutInnerObjects(QueryParam queryParam){
  final String arpaName=queryParam.getQ();
  final NetworkInBytes network=ArpaUtil.parseArpa(arpaName);
  List<Domain> result=null;
  final int hexCharSize=IpUtil.getHexCharSize(network.getIpVersion());
  String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  final String finalSql=sql;
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(finalSql);
      ps.setBytes(1,network.getStartAddress());
      ps.setBytes(2,network.getStartAddress());
      ps.setString(3,network.getIpVersion().getName());
      ps.setInt(4,hexCharSize);
      ps.setInt(5,hexCharSize);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}
Program: 37171
Project: 37171
Buggy source:
protected void convertCustomProperties(DTO dto,MODEL model){
  Map<String,String> customProperties=dto.getCustomProperties();
  model.setCustomProperties(customProperties);
  model.setCustomPropertiesJsonVal(JsonUtil.serializeMap(customProperties));
}

Fixed version (ground truth):
protected void convertCustomProperties(DTO dto,MODEL model){
  Map<String,String> customProperties=dto.getCustomProperties();
  model.setCustomProperties(customProperties);
  if (null == customProperties || customProperties.isEmpty()) {
    return;
  }
  model.setCustomPropertiesJsonVal(JsonUtil.serializeMap(customProperties));
}
Program: 37172
Project: 37172
Buggy source:
public static Date parse(String dateString,String format){
  try {
    Date date=new SimpleDateFormat(format).parse(dateString);
    return date;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public static Date parse(String dateString,String format){
  try {
    SimpleDateFormat sdf=new SimpleDateFormat(format);
    sdf.setLenient(false);
    Date date=sdf.parse(dateString);
    return date;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return null;
  }
}
Program: 37173
Project: 37173
Buggy source:
/** 
 * check if is update URI.
 * @param uri URI.
 * @return true if is update URI, false if not.
 */
public static boolean isUpdateUri(String uri){
  return StringUtils.startsWith(uri,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * check if is update URI.
 * @param uri URI.
 * @return true if is update URI, false if not.
 */
public static boolean isUpdateUri(HttpServletRequest request){
  String uri=request.getRequestURI();
  String contextPath=request.getContextPath();
  if (StringUtils.equals(contextPath,"String_Node_Str")) {
    contextPath=StringUtils.EMPTY;
  }
  return StringUtils.startsWith(uri,contextPath + "String_Node_Str");
}
Program: 37174
Project: 37174
Buggy source:
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  String uri=req.getRequestURI();
  if (FilterHelper.isUpdateUri(uri)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  if (FilterHelper.isUpdateUri(req)) {
    return false;
  }
  return true;
}
Program: 37175
Project: 37175
Buggy source:
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  String uri=req.getRequestURI();
  if (FilterHelper.isUpdateUri(uri)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  if (FilterHelper.isUpdateUri(req)) {
    return false;
  }
  return true;
}
Program: 37176
Project: 37176
Buggy source:
/** 
 * check if HTTP METHOD is valid.
 * @param request HttpServletRequest
 * @return true if valid, false if not
 */
private boolean httpMethodIsValid(HttpServletRequest request){
  String method=request.getMethod();
  String uri=request.getRequestURI();
  if (FilterHelper.isUpdateUri(uri)) {
    boolean httpMethodIsValid=UPDATE_ALLOW_METHODS.contains(method);
    return httpMethodIsValid;
  }
 else {
    boolean httpMethodIsValid=QUERY_ALLOW_METHODS.contains(method);
    return httpMethodIsValid;
  }
}

Fixed version (ground truth):
/** 
 * check if HTTP METHOD is valid.
 * @param request HttpServletRequest
 * @return true if valid, false if not
 */
private boolean httpMethodIsValid(HttpServletRequest request){
  String method=request.getMethod();
  if (FilterHelper.isUpdateUri(request)) {
    boolean httpMethodIsValid=UPDATE_ALLOW_METHODS.contains(method);
    return httpMethodIsValid;
  }
 else {
    boolean httpMethodIsValid=QUERY_ALLOW_METHODS.contains(method);
    return httpMethodIsValid;
  }
}
Program: 37177
Project: 37177
Buggy source:
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  String uri=req.getRequestURI();
  if (FilterHelper.isUpdateUri(uri)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  if (FilterHelper.isUpdateUri(req)) {
    return false;
  }
  return true;
}
Program: 37178
Project: 37178
Buggy source:
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  String uri=req.getRequestURI();
  if (FilterHelper.isUpdateUri(uri)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean needFilter(HttpServletRequest req,HttpServletResponse res){
  if (FilterHelper.isUpdateUri(req)) {
    return false;
  }
  return true;
}
Program: 37179
Project: 37179
Buggy source:
/** 
 * set network id to domain.
 * @param dto DTO.
 * @param domain domain.
 */
private void convertNetworkIdIfExist(DomainDto dto,Domain domain){
  if (StringUtils.isBlank(dto.getNetworkHandle())) {
    return;
  }
  Long networkId=dao.findIdByHandle(dto.getNetworkHandle());
  if (null != networkId) {
    domain.setNetworkId(networkId);
  }
}

Fixed version (ground truth):
/** 
 * set network id to domain.
 * @param dto DTO.
 * @param domain domain.
 */
private void convertNetworkIdIfExist(DomainDto dto,Domain domain){
  if (StringUtils.isBlank(dto.getNetworkHandle())) {
    return;
  }
  Long networkId=networkDao.findIdByHandle(dto.getNetworkHandle());
  if (null != networkId) {
    domain.setNetworkId(networkId);
  }
}
Program: 37180
Project: 37180
Buggy source:
/** 
 * check if is not-resolved-ascii domain.
 * @param domainName domainName.
 * @param punyDomainName punyDomainName.
 * @param punyWithoutLastPoint punyWithoutLastPoint.
 * @param domainNameWithoutLastPoint domainNameWithoutLastPoint.
 * @param forSearch forSearch.
 * @return true if is not-resolved-ascii domain.
 */
private static boolean nonReservedAsciiDomain(String domainName,String punyDomainName,String punyWithoutLastPoint,String domainNameWithoutLastPoint,boolean forSearch){
  if (!forSearch && StringUtils.startsWith(domainName,ACE_PREFIX)) {
    return false;
  }
  return domainName.equals(punyDomainName) || domainNameWithoutLastPoint.equals(punyWithoutLastPoint);
}

Fixed version (ground truth):
/** 
 * check if is not-resolved-ascii domain.
 * @param domainName domainName.
 * @param punyDomainName punyDomainName.
 * @param punyWithoutLastPoint punyWithoutLastPoint.
 * @param domainNameWithoutLastPoint domainNameWithoutLastPoint.
 * @param forSearch forSearch.
 * @return true if is not-resolved-ascii domain.
 */
private static boolean nonReservedAsciiDomain(String domainName,String punyDomainName,String punyWithoutLastPoint,String domainNameWithoutLastPoint,boolean forSearch){
  if (!forSearch && StringUtils.startsWith(domainName,ACE_PREFIX)) {
    return false;
  }
  if (!forSearch && 2 == StringUtils.indexOf(domainName,"String_Node_Str")) {
    return false;
  }
  return domainName.equals(punyDomainName) || domainNameWithoutLastPoint.equals(punyWithoutLastPoint);
}
Program: 37183
Project: 37183
Buggy source:
/** 
 * convert VCARD to JSON.
 * @return JSON string.
 */
public String toJSON(){
  VCard vcard=new VCard();
  if (null == entity) {
    return this.writeJSON(vcard);
  }
  for (  JcardPropertyConverter converter : converters) {
    converter.convertAndSetProperty(vcard,entity);
  }
  return this.writeJSON(vcard);
}

Fixed version (ground truth):
/** 
 * convert VCARD to JSON.
 * @return JSON string.
 */
public String toJSON(){
  VCard vcard=new VCard();
  if (null == entity) {
    return this.writeJSON(vcard);
  }
  for (  JcardPropertyConverter converter : converters) {
    converter.convertAndSetProperty(vcard,entity);
  }
  if (!vcard.iterator().hasNext()) {
    return null;
  }
  return this.writeJSON(vcard);
}
Program: 37184
Project: 37184
Buggy source:
/** 
 * do pre process request address.
 * @param request request.
 * @param response response.
 * @throws Exception Exception.
 * @return true if success processed,and can do service operation; false ifnot.
 */
@Override public boolean preProcess(HttpServletRequest request,HttpServletResponse response) throws Exception {
  if (ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax()) {
    writeError509Response(response);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * do pre process request address.
 * @param request request.
 * @param response response.
 * @throws Exception Exception.
 * @return true if success processed,and can do service operation; false ifnot.
 */
@Override public boolean preProcess(HttpServletRequest request,HttpServletResponse response) throws Exception {
  String ip=request.getRemoteAddr();
  if (ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax(ip)) {
    writeError509Response(response);
    return false;
  }
  return true;
}
Program: 37185
Project: 37185
Buggy source:
/** 
 * do post process.
 * @param request request.
 * @param response response.
 * @throws Exception Exception.
 * @return true .
 */
@Override public boolean postProcess(HttpServletRequest request,HttpServletResponse response) throws Exception {
  ConnectionControlService.decrementAndGetCurrentQueryCount();
  return true;
}

Fixed version (ground truth):
/** 
 * do post process.
 * @param request request.
 * @param response response.
 * @throws Exception Exception.
 * @return true .
 */
@Override public boolean postProcess(HttpServletRequest request,HttpServletResponse response) throws Exception {
  String ip=request.getRemoteAddr();
  ConnectionControlService.decrementAndGetCurrentQueryCount(ip);
  return true;
}
Program: 37186
Project: 37186
Buggy source:
/** 
 * increment concurrent query count, and check if exceed max count.MUST call decrementAndGetCurrentQueryCount after query.
 * @return true if exceed, false if not.
 */
public static boolean incrementConcurrentQCountAndCheckIfExceedMax(){
  LOGGER.debug("String_Node_Str");
  if (isConcurrentCountNotLimit()) {
    return false;
  }
  int count=CONCURRENT_Q_COUNT.getAndIncrement();
  LOGGER.debug("String_Node_Str",count);
  if (count > RdapProperties.getMaxConcurrentCount() - 1) {
    LOGGER.debug("String_Node_Str",RdapProperties.getMaxConcurrentCount());
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * increment concurrent query count, and check if exceed max count.MUST call decrementAndGetCurrentQueryCount after query.
 * @param ip
 * @return true if exceed, false if not.
 */
public static boolean incrementConcurrentQCountAndCheckIfExceedMax(String ip){
  LOGGER.debug("String_Node_Str");
  if (isConcurrentCountNotLimit()) {
    return false;
  }
  if (isInIpWhiteList(ip)) {
    return false;
  }
  int count=CONCURRENT_Q_COUNT.getAndIncrement();
  LOGGER.debug("String_Node_Str",count);
  if (count > RdapProperties.getMaxConcurrentCount() - 1) {
    LOGGER.debug("String_Node_Str",RdapProperties.getMaxConcurrentCount());
    return true;
  }
  return false;
}
Program: 37187
Project: 37187
Buggy source:
/** 
 * decrement current query count.
 */
public static void decrementAndGetCurrentQueryCount(){
  LOGGER.debug("String_Node_Str");
  if (isConcurrentCountNotLimit()) {
    return;
  }
  int count=CONCURRENT_Q_COUNT.decrementAndGet();
  LOGGER.debug("String_Node_Str",count);
}

Fixed version (ground truth):
/** 
 * decrement current query count.
 * @param ip
 */
public static void decrementAndGetCurrentQueryCount(String ip){
  LOGGER.debug("String_Node_Str");
  if (isConcurrentCountNotLimit()) {
    return;
  }
  if (isInIpWhiteList(ip)) {
    return;
  }
  int count=CONCURRENT_Q_COUNT.decrementAndGet();
  LOGGER.debug("String_Node_Str",count);
}
Program: 37188
Project: 37188
Buggy source:
/** 
 * get exceed rate limit.
 * @param ip client ip.
 * @return true if exceed rate limit,false if not.
 */
public static boolean exceedRateLimit(String ip){
  if (!hasLimit()) {
    return false;
  }
  LOGGER.debug("String_Node_Str",ip);
  if (StringUtils.isBlank(ip)) {
    return false;
  }
  if (isInIpWhiteList(ip)) {
    return false;
  }
  Long lastAccessTime=CLIENT_IP2LAST_ACCESS_TIME_MAP.get(ip);
  long currentTimeMillis=System.currentTimeMillis();
  if (hasLimit()) {
    CLIENT_IP2LAST_ACCESS_TIME_MAP.put(ip,currentTimeMillis);
  }
  if (null == lastAccessTime) {
    return false;
  }
  long accessTimeInterval=currentTimeMillis - lastAccessTime;
  if (PrincipalHolder.getPrincipal().isAnonymous()) {
    LOGGER.debug("String_Node_Str");
    return accessTimeInterval <= MIN_SECONDS_ACCESS_INTERVAL_FOR_ANONYMOUS;
  }
 else {
    LOGGER.debug("String_Node_Str");
    return accessTimeInterval <= MIN_SECONDS_ACCESS_INTERVAL_AUTHED;
  }
}

Fixed version (ground truth):
/** 
 * get exceed rate limit.
 * @param ip client ip.
 * @return true if exceed rate limit,false if not.
 */
public static boolean exceedRateLimit(String ip){
  if (!hasLimit()) {
    return false;
  }
  LOGGER.debug("String_Node_Str",ip);
  if (isInIpWhiteList(ip)) {
    return false;
  }
  Long lastAccessTime=CLIENT_IP2LAST_ACCESS_TIME_MAP.get(ip);
  long currentTimeMillis=System.currentTimeMillis();
  if (hasLimit()) {
    CLIENT_IP2LAST_ACCESS_TIME_MAP.put(ip,currentTimeMillis);
  }
  if (null == lastAccessTime) {
    return false;
  }
  long accessTimeInterval=currentTimeMillis - lastAccessTime;
  if (PrincipalHolder.getPrincipal().isAnonymous()) {
    LOGGER.debug("String_Node_Str");
    return accessTimeInterval <= MIN_SECONDS_ACCESS_INTERVAL_FOR_ANONYMOUS;
  }
 else {
    LOGGER.debug("String_Node_Str");
    return accessTimeInterval <= MIN_SECONDS_ACCESS_INTERVAL_AUTHED;
  }
}
Program: 37189
Project: 37189
Buggy source:
/** 
 * check if ip in white list.
 * @param ip ip.
 * @return true if in white list, false if not.
 */
private static boolean isInIpWhiteList(String ip){
  LOGGER.debug("String_Node_Str",IP_WHITE_LIST_FOR_ACCESS_INTERVAL);
  LOGGER.debug("String_Node_Str",ip);
  List<String> whiteList=IP_WHITE_LIST_FOR_ACCESS_INTERVAL;
  if (null != whiteList && whiteList.contains(ip)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check if ip in white list.
 * @param ip ip.
 * @return true if in white list, false if not.
 */
private static boolean isInIpWhiteList(String ip){
  LOGGER.debug("String_Node_Str",IP_WHITE_LIST_FOR_ACCESS_INTERVAL);
  LOGGER.debug("String_Node_Str",ip);
  if (StringUtils.isBlank(ip)) {
    return false;
  }
  List<String> whiteList=IP_WHITE_LIST_FOR_ACCESS_INTERVAL;
  if (null != whiteList && whiteList.contains(ip)) {
    return true;
  }
  return false;
}
Program: 37190
Project: 37190
Buggy source:
/** 
 * test incrementConcurrentQCountAndCheckIfExceedMax.
 */
@Test public void testIncrementConcurrentQCountAndCheckIfExceedMax(){
  RdapProperties prop=new RdapProperties();
  ReflectionTestUtils.setField(prop,"String_Node_Str",3);
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
  assertTrue(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
  ConnectionControlService.decrementAndGetCurrentQueryCount();
  assertTrue(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
  ConnectionControlService.decrementAndGetCurrentQueryCount();
  ConnectionControlService.decrementAndGetCurrentQueryCount();
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax());
}

Fixed version (ground truth):
/** 
 * test incrementConcurrentQCountAndCheckIfExceedMax.
 */
@Test public void testIncrementConcurrentQCountAndCheckIfExceedMax(){
  RdapProperties prop=new RdapProperties();
  ReflectionTestUtils.setField(prop,"String_Node_Str",3);
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
  assertTrue(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
  ConnectionControlService.decrementAndGetCurrentQueryCount("String_Node_Str");
  assertTrue(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
  ConnectionControlService.decrementAndGetCurrentQueryCount("String_Node_Str");
  ConnectionControlService.decrementAndGetCurrentQueryCount("String_Node_Str");
  assertFalse(ConnectionControlService.incrementConcurrentQCountAndCheckIfExceedMax("String_Node_Str"));
}
Program: 37191
Project: 37191
Buggy source:
/** 
 * Query template method. <pre> All sub classes should call this method for query. Note:queryParam.convertParam()  and queryParam.convertParam()  can throw any Exception, and these exceptions will handled  as HTTP 400 error. </pre>
 * @param queryParam queryParam.
 * @return ResponseEntity.
 */
@SuppressWarnings("String_Node_Str") protected ResponseEntity queryTemplate(QueryParam queryParam){
  try {
    queryParam.fillParam();
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  QueryFilterResult preParamFilterResult=queryFilterManager.preParamValidate(queryParam,getQueryFilters());
  if (null != preParamFilterResult && preParamFilterResult.hasResult()) {
    return preParamFilterResult.getResult();
  }
  ValidationResult validateResult=validateParam(queryParam);
  if (validateResult.hasError()) {
    return handleError(validateResult);
  }
  QueryFilterResult postParamFilterResult=queryFilterManager.postParamValidate(queryParam,getQueryFilters());
  if (null != postParamFilterResult && postParamFilterResult.hasResult()) {
    return postParamFilterResult.getResult();
  }
  try {
    queryParam.convertParam();
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  ResponseEntity result=doQuery(queryParam);
  QueryFilterResult postQueryResult=queryFilterManager.postQuery(queryParam,result,getQueryFilters());
  if (null != postQueryResult && postQueryResult.hasResult()) {
    return postQueryResult.getResult();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Query template method. <pre> All sub classes should call this method for query. Note:queryParam.convertParam()  and queryParam.convertParam()  can throw any Exception, and these exceptions will handled  as HTTP 400 error. </pre>
 * @param queryParam queryParam.
 * @return ResponseEntity.
 */
@SuppressWarnings("String_Node_Str") protected ResponseEntity queryTemplate(QueryParam queryParam){
  try {
    queryParam.fillParam();
  }
 catch (  Exception e) {
    LOGGER.warn("String_Node_Str",e);
    return RestResponseUtil.createResponse400();
  }
  QueryFilterResult preParamFilterResult=queryFilterManager.preParamValidate(queryParam,getQueryFilters());
  if (null != preParamFilterResult && preParamFilterResult.hasResult()) {
    return preParamFilterResult.getResult();
  }
  ValidationResult validateResult=validateParam(queryParam);
  if (validateResult.hasError()) {
    return handleError(validateResult);
  }
  QueryFilterResult postParamFilterResult=queryFilterManager.postParamValidate(queryParam,getQueryFilters());
  if (null != postParamFilterResult && postParamFilterResult.hasResult()) {
    return postParamFilterResult.getResult();
  }
  try {
    queryParam.convertParam();
  }
 catch (  Exception e) {
    LOGGER.warn("String_Node_Str",e);
    return RestResponseUtil.createResponse400();
  }
  ResponseEntity result=doQuery(queryParam);
  QueryFilterResult postQueryResult=queryFilterManager.postQuery(queryParam,result,getQueryFilters());
  if (null != postQueryResult && postQueryResult.hasResult()) {
    return postQueryResult.getResult();
  }
  return result;
}
Program: 37192
Project: 37192
Buggy source:
/** 
 * get query filters.
 * @return service filters.
 */
protected List<QueryFilter> getQueryFilters(){
  return new ArrayList<QueryFilter>();
}

Fixed version (ground truth):
/** 
 * get query filters.
 * @return service filters.
 */
protected List<QueryFilter> getQueryFilters(){
  LOGGER.warn("String_Node_Str");
  return new ArrayList<QueryFilter>();
}
Program: 37193
Project: 37193
Buggy source:
/** 
 * handle error in validation result. <pre> unrecognized error will be handled as HTTP 400 error. </pre>
 * @param result result.
 * @return ResponseEntity.
 */
@SuppressWarnings("String_Node_Str") private ResponseEntity handleError(ValidationResult result){
  ValidationError error=result.getFirstError();
  if (null != error) {
    HttpValidationError httpError=(HttpValidationError)error;
    return RestResponseUtil.createCommonErrorResponse(httpError.getStatusCode());
  }
  return RestResponseUtil.createResponse400();
}

Fixed version (ground truth):
/** 
 * handle error in validation result. <pre> unrecognized error will be handled as HTTP 400 error. </pre>
 * @param result result.
 * @return ResponseEntity.
 */
@SuppressWarnings("String_Node_Str") private ResponseEntity handleError(ValidationResult result){
  ValidationError error=result.getFirstError();
  if (null != error) {
    HttpValidationError httpError=(HttpValidationError)error;
    return RestResponseUtil.createCommonErrorResponse(httpError.getStatusCode());
  }
  LOGGER.warn("String_Node_Str",result);
  return RestResponseUtil.createResponse400();
}
Program: 37194
Project: 37194
Buggy source:
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @param forSearch is for search.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName,boolean forSearch){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (domainName.contains(BLANK_IN_DOMAIN)) {
    return false;
  }
  if (StringUtils.containsAny(domainName,DISALLOWED_DELIMITERS)) {
    return false;
  }
  if (!forSearch && !isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  String punyDomainName=domainName;
  try {
    punyDomainName=geneDomainPunyName(domainName);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
    return false;
  }
  String punyWithoutLastPoint=deleteLastPoint(punyDomainName);
  if (!validateDomainLength(punyWithoutLastPoint)) {
    return false;
  }
  String domainNameWithoutLastPoint=deleteLastPoint(domainName);
  String[] splits=StringUtils.split(punyWithoutLastPoint,"String_Node_Str");
  if (splits.length > MAX_DOMAIN_LABEL) {
    return false;
  }
  if (domainName.equals(punyDomainName) || domainNameWithoutLastPoint.equals(punyWithoutLastPoint)) {
    return isLdh(domainName);
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}

Fixed version (ground truth):
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @param forSearch is for search.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName,boolean forSearch){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (domainName.contains(BLANK_IN_DOMAIN)) {
    return false;
  }
  if (StringUtils.containsAny(domainName,DISALLOWED_DELIMITERS)) {
    return false;
  }
  if (!forSearch && !isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  String punyDomainName=domainName;
  try {
    punyDomainName=geneDomainPunyName(domainName);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
    return false;
  }
  String punyWithoutLastPoint=deleteLastPoint(punyDomainName);
  if (!validateDomainLength(punyWithoutLastPoint)) {
    return false;
  }
  String domainNameWithoutLastPoint=deleteLastPoint(domainName);
  String[] splits=StringUtils.split(punyWithoutLastPoint,"String_Node_Str");
  if (splits.length > MAX_DOMAIN_LABEL) {
    return false;
  }
  if (nonReservedAsciiDomain(domainName,punyDomainName,punyWithoutLastPoint,domainNameWithoutLastPoint,forSearch)) {
    return isLdh(domainName);
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}
Program: 37195
Project: 37195
Buggy source:
/** 
 * testUrlDecodeAndReplaceAsciiToLowercase.
 * @throws DecodeException 
 */
@Test public void testUrlDecodeAndReplaceAsciiToLowercase() throws DecodeException {
  assertEquals("String_Node_Str",DomainUtil.urlDecodeAndReplaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * testUrlDecodeAndReplaceAsciiToLowercase.
 * @throws DecodeException
 */
@Test public void testUrlDecodeAndReplaceAsciiToLowercase() throws DecodeException {
  assertEquals("String_Node_Str",DomainUtil.urlDecodeAndReplaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
  assertEquals("String_Node_Str",DomainUtil.replaceAsciiToLowercase("String_Node_Str"));
}
Program: 37197
Project: 37197
Buggy source:
@Override protected void initValidators(){
  addValidator(DOMAIN_NAME_VALIDATOR);
}

Fixed version (ground truth):
@Override protected void initValidators(){
  addValidator(DOMAIN_NAME_ALABEL_VALIDATOR);
  addValidator(DOMAIN_NAME_VALIDATOR);
}
Program: 37198
Project: 37198
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryInvalidDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryInvalidDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
  commonQueryInvalidDomain("String_Node_Str");
}
Program: 37199
Project: 37199
Buggy source:
@Override public boolean supports(Class<?> clazz){
  Class superClazz=clazz.getSuperclass();
  return superClazz.equals(DomainSearchParam.class) || superClazz.equals(NameserverSearchParam.class) || superClazz.equals(EntitySearchParam.class);
}

Fixed version (ground truth):
@Override public boolean supports(Class<?> clazz){
  Class superClazz=clazz.getSuperclass();
  return superClazz.equals(DomainSearchParam.class) || superClazz.equals(NameserverSearchParam.class) || superClazz.equals(EntitySearchParam.class)|| clazz.equals(HelpQueryParam.class);
}
Program: 37200
Project: 37200
Buggy source:
/** 
 * <pre> Query help. URI:/help. This service is not under permission control. This service is not under policy control. </pre>
 * @param request HttpServletRequest.
 * @param response HttpServletResponse
 * @return JSON formated result,with HTTP code.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity queryHelp(HttpServletRequest request,HttpServletResponse response) throws DecodeException {
  String lastSpliInURI=RequestUtil.getLastSplitInURI(request);
  if (!"String_Node_Str".equals(lastSpliInURI)) {
    return RestResponseUtil.createResponse400();
  }
  Help result=queryService.queryHelp(new HelpQueryParam("String_Node_Str"));
  if (null != result) {
    return RestResponseUtil.createResponse200(result);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * <pre> Query help. URI:/help. This service is not under permission control. This service is not under policy control. </pre>
 * @param request HttpServletRequest.
 * @param response HttpServletResponse
 * @return JSON formated result,with HTTP code.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseEntity queryHelp(HttpServletRequest request,HttpServletResponse response) throws DecodeException {
  return super.query(new HelpQueryParam(request));
}
Program: 37201
Project: 37201
Buggy source:
/** 
 * default constructor.
 * @param q query string.
 */
public HelpQueryParam(String q){
  super(q);
}

Fixed version (ground truth):
/** 
 * default constructor.
 * @param q query string.
 */
public HelpQueryParam(HttpServletRequest request){
  super(request);
}
Program: 37202
Project: 37202
Buggy source:
@Override protected void initValidators(){
}

Fixed version (ground truth):
@Override protected void initValidators(){
  super.addValidator(new SearchUriValidator());
}
Program: 37203
Project: 37203
Buggy source:
/** 
 * Before.
 * @throws Exception Exception.
 */
@Before public void before() throws Exception {
  resetDefaultMaxSizeSearch();
}

Fixed version (ground truth):
/** 
 * Before.
 * @throws Exception Exception.
 */
@Before public void before() throws Exception {
  resetDefaultMaxSizeSearch();
  rdapConformanceService.initRdapConformance();
}
Program: 37205
Project: 37205
Buggy source:
/** 
 * common query exist IP 200.
 * @param queryIP query ip address.
 * @param lang a string of language
 * @throws Exception Exception.
 */
private void commonQueryHelp() throws Exception {
  mockMvc.perform(get(urlPath).accept(MediaType.parseMediaType(rdapJson))).andExpect(status().isOk()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").exists());
}

Fixed version (ground truth):
/** 
 * common query exist IP 200.
 * @param queryIP query ip address.
 * @param lang a string of language
 * @throws Exception Exception.
 */
private void commonQueryHelp() throws Exception {
  mockMvc.perform(get(urlPath).accept(MediaType.parseMediaType(rdapJson))).andExpect(status().isOk()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").exists()).andExpect(jsonPath("String_Node_Str").exists());
}
Program: 37206
Project: 37206
Buggy source:
@Override public QueryFilterResult postQuery(QueryParam queryParam,ResponseEntity responseEntity){
  customColumnPolicyService.applyPolicy(responseEntity);
  return null;
}

Fixed version (ground truth):
@Override public QueryFilterResult postQuery(QueryParam queryParam,ResponseEntity responseEntity){
  Object responseBody=responseEntity.getBody();
  if (null == responseBody) {
    return null;
  }
  if (responseBody instanceof ErrorMessage) {
    return null;
  }
  customColumnPolicyService.applyPolicy(responseBody);
  return null;
}
Program: 37207
Project: 37207
Buggy source:
/** 
 * add notices to model.
 * @param model model.
 */
public void addNotices(BaseModel model){
  if (null == model) {
    return;
  }
  List<Notice> notices=noticeService.getAllNotTruncatedNotice();
  addTruncatedNotice(model,notices);
  model.setNotices(notices);
}

Fixed version (ground truth):
/** 
 * add notices to model.
 * @param model model.
 */
public void addNotices(BaseModel model){
  if (null == model) {
    return;
  }
  List<Notice> notices=new ArrayList<Notice>();
  List<Notice> notTruncatedNotices=noticeService.getAllNotTruncatedNotice();
  if (null != notTruncatedNotices) {
    notices.addAll(notTruncatedNotices);
  }
  List<Notice> truncatedNotices=getTruncatedNotice(model);
  if (null != truncatedNotices) {
    notices.addAll(truncatedNotices);
  }
  model.setNotices(notices);
}
Program: 37208
Project: 37208
Buggy source:
/** 
 * check if str is valid search pattern. <pre> StringUtil.checkIsValidSearchPattern(null)      = false StringUtil.checkIsValidSearchPattern("")        = false StringUtil.checkIsValidSearchPattern(" ")       = false StringUtil.checkIsValidSearchPattern("*")       = false StringUtil.checkIsValidSearchPattern("*bob")    = false StringUtil.checkIsValidSearchPattern("*bob*")   = false </pre>
 * @param str str.
 * @return true if valid,false if not.
 */
public static boolean checkIsValidSearchPattern(String str){
  if (StringUtils.isBlank(str)) {
    return false;
  }
  if (ASTERISK.equals(str) || str.startsWith(ASTERISK)) {
    return false;
  }
  return containsAtMostOnce(str,ASTERISK);
}

Fixed version (ground truth):
/** 
 * check if str is valid search pattern. <pre> StringUtil.checkIsValidSearchPattern(null)      = false StringUtil.checkIsValidSearchPattern("")        = false StringUtil.checkIsValidSearchPattern(" ")       = false StringUtil.checkIsValidSearchPattern("*")       = false StringUtil.checkIsValidSearchPattern("*bob")    = true StringUtil.checkIsValidSearchPattern("*bob*")   = false </pre>
 * @param str str.
 * @return true if valid,false if not.
 */
public static boolean checkIsValidSearchPattern(String str){
  if (StringUtils.isBlank(str)) {
    return false;
  }
  if (ASTERISK.equals(str)) {
    return false;
  }
  return containsAtMostOnce(str,ASTERISK);
}
Program: 37209
Project: 37209
Buggy source:
/** 
 * test checkIsValidSearchPattern.
 */
@Test public void testCheckIsValidSearchPattern() throws UnsupportedEncodingException {
  assertTrue(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertTrue(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * test checkIsValidSearchPattern.
 */
@Test public void testCheckIsValidSearchPattern() throws UnsupportedEncodingException {
  assertTrue(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertTrue(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertTrue(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
  assertFalse(StringUtil.checkIsValidSearchPattern("String_Node_Str"));
}
Program: 37211
Project: 37211
Buggy source:
/** 
 * query redirect domain or nameserver.
 * @param queryParam queryParam.
 * @param paramName the string param.
 * @return ResponseEntity.
 */
protected ResponseEntity queryRedirectDomainOrNs(QueryParam queryParam,String paramName){
  LOGGER.debug("String_Node_Str",queryParam);
  RedirectResponse redirect=redirectService.queryDomain(queryParam);
  String servicePartUri=QueryUri.DOMAIN.getName();
  if (queryParam instanceof NameserverQueryParam) {
    servicePartUri=QueryUri.NAMESERVER.getName();
  }
  if (null != redirect && StringUtils.isNotBlank(redirect.getUrl())) {
    String redirectUrl=StringUtil.generateEncodedRedirectURL(paramName,servicePartUri,redirect.getUrl());
    return RestResponseUtil.createResponse301(redirectUrl);
  }
  LOGGER.debug("String_Node_Str",queryParam);
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * query redirect domain or nameserver.
 * @param queryParam queryParam.
 * @param paramName the string param.
 * @return ResponseEntity.
 */
protected ResponseEntity queryRedirectDomainOrNs(QueryParam queryParam,String paramName){
  LOGGER.debug("String_Node_Str",queryParam);
  RedirectResponse redirect=redirectService.queryDomain(queryParam);
  if (null != redirect && StringUtils.isNotBlank(redirect.getUrl())) {
    String redirectUrl=StringUtil.generateEncodedRedirectURL(paramName,queryParam.getQueryUri().getName(),redirect.getUrl());
    return RestResponseUtil.createResponse301(redirectUrl);
  }
  LOGGER.debug("String_Node_Str",queryParam);
  return RestResponseUtil.createResponse404();
}
Program: 37212
Project: 37212
Buggy source:
@Override public boolean supports(Class<?> clazz){
  return clazz.equals(DomainQueryParam.class);
}

Fixed version (ground truth):
@Override public boolean supports(Class<?> clazz){
  return clazz.equals(DomainQueryParam.class) || clazz.equals(NameserverQueryParam.class);
}
Program: 37213
Project: 37213
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 nsName 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.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryNameserver(@PathVariable String nsName,HttpServletRequest request) throws DecodeException {
  QueryParam queryParam=new DomainQueryParam(request);
  return super.query(queryParam);
}

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 nsName 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.
 * @throws DecodeException DecodeException.
 */
@RequestMapping(value={"String_Node_Str"},method=RequestMethod.GET) @ResponseBody public ResponseEntity queryNameserver(@PathVariable String nsName,HttpServletRequest request) throws DecodeException {
  QueryParam queryParam=new NameserverQueryParam(request);
  return super.query(queryParam);
}
Program: 37214
Project: 37214
Buggy source:
@Override public void convertParam() throws Exception {
  String decodeDomain=getQ();
  decodeDomain=StringUtil.foldCaseAndNormalization(decodeDomain);
  LOGGER.debug("String_Node_Str",decodeDomain);
  String punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  super.setQ(decodeDomain);
  setPunyName(punyDomainName);
}

Fixed version (ground truth):
@Override public void convertParam() throws Exception {
  String decodeDomain=getQ();
  decodeDomain=StringUtil.foldCase(decodeDomain);
  LOGGER.debug("String_Node_Str",decodeDomain);
  String punyDomainName=DomainUtil.geneDomainPunyName(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  super.setQ(decodeDomain);
  setPunyName(punyDomainName);
}
Program: 37215
Project: 37215
Buggy source:
@Override public void fillParam() throws Exception {
  String domainName=getLastSplitInURI(getRequest());
  super.setOriginalQ(domainName);
  String decodeDomain=DomainUtil.urlDecodeAndReplaceAsciiToLowercase(domainName);
  super.setQ(decodeDomain);
}

Fixed version (ground truth):
@Override public void fillParam() throws Exception {
  String domainName=getLastSplitInURI(getRequest());
  super.setOriginalQ(domainName);
  String decodeDomain=DomainUtil.urlDecodeAndReplaceAsciiToLowercase(domainName);
  decodeDomain=StringUtil.getNormalization(decodeDomain);
  super.setQ(decodeDomain);
}
Program: 37216
Project: 37216
Buggy source:
@Override public void convertParam() throws Exception {
  String decodeDomain=getQ();
  decodeDomain=StringUtil.foldCaseAndNormalization(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  setQ(decodeDomain);
  setPunyName(decodeDomain);
}

Fixed version (ground truth):
@Override public void convertParam() throws Exception {
  String decodeDomain=getQ();
  decodeDomain=StringUtil.foldCase(decodeDomain);
  decodeDomain=DomainUtil.deleteLastPoint(decodeDomain);
  setQ(decodeDomain);
  setPunyName(decodeDomain);
}
Program: 37217
Project: 37217
Buggy source:
@Override public void fillParam() throws Exception {
  String domainName=getParameter(getRequest(),DomainSearchType.NAME.getName());
  String decodeDomain=domainName;
  decodeDomain=DomainUtil.iso8859Decode(domainName);
  decodeDomain=DomainUtil.urlDecodeAndReplaceAsciiToLowercase(decodeDomain);
  setQ(decodeDomain);
  setPunyName(decodeDomain);
}

Fixed version (ground truth):
@Override public void fillParam() throws Exception {
  String domainName=getParameter(getRequest(),DomainSearchType.NAME.getName());
  String decodeDomain=domainName;
  decodeDomain=DomainUtil.iso8859Decode(domainName);
  decodeDomain=DomainUtil.urlDecodeAndReplaceAsciiToLowercase(decodeDomain);
  decodeDomain=StringUtil.getNormalization(decodeDomain);
  setQ(decodeDomain);
  setPunyName(decodeDomain);
}