nus-yam/ex-repair huggingface dataset:
Program: 37500
Project: 37500
Buggy source:
/** 
 * parseQueryIpV6Mask.
 * @param strQuery for ip string v6
 * @param ipV6 for ip BigDecimal style
 */
private void parseQueryIpV6Mask(String strQuery,BigDecimal[] ipV6){
  final int lowLimitShift=64;
  int lowShift=lowLimitShift * 2 - (int)numMask;
  BigDecimal powDecimalBase=BigDecimal.valueOf(2L);
  BigDecimal endSubDecimalBase=BigDecimal.valueOf(1L);
  ipQueryStartHigh=ipV6[0];
  ipQueryEndHigh=ipV6[0];
  if (numMask > lowLimitShift) {
    int highShift=(int)numMask - lowLimitShift;
    BigDecimal powDecimalhigh=powDecimalBase.pow(highShift);
    BigDecimal modDecimalHigh=ipV6[0].remainder(powDecimalhigh);
    ipQueryStartHigh=ipV6[0].subtract(modDecimalHigh);
    lowShift=lowLimitShift;
    BigDecimal highEndPlusDecimal=powDecimalhigh.subtract(endSubDecimalBase);
    ipQueryEndHigh=ipQueryStartHigh.add(highEndPlusDecimal);
  }
  BigDecimal powDecimalLow=powDecimalBase.pow(lowShift);
  BigDecimal modDecimalLow=ipV6[1].remainder(powDecimalLow);
  ipQueryStartLow=ipV6[1].subtract(modDecimalLow);
  BigDecimal lowEndPlusDecimal=powDecimalLow.subtract(endSubDecimalBase);
  ipQueryEndLow=ipQueryStartLow.add(lowEndPlusDecimal);
}

Fixed version (ground truth):
/** 
 * parseQueryIpV6Mask.
 * @param strQuery for ip string v6
 * @param ipV6 for ip BigDecimal style
 */
private void parseQueryIpV6Mask(String strQuery,BigDecimal[] ipV6){
  final int lowLimitShift=64;
  long maskRangeBytes=0;
  if (numMask > 0) {
    maskRangeBytes=lowLimitShift * 2 - numMask;
  }
  int lowShift=(int)maskRangeBytes;
  BigDecimal powDecimalBase=BigDecimal.valueOf(2L);
  BigDecimal endSubDecimalBase=BigDecimal.valueOf(1L);
  ipQueryStartHigh=ipV6[0];
  ipQueryEndHigh=ipV6[0];
  if (maskRangeBytes > lowLimitShift) {
    int highShift=(int)maskRangeBytes - lowLimitShift;
    BigDecimal powDecimalhigh=powDecimalBase.pow(highShift);
    BigDecimal modDecimalHigh=ipV6[0].remainder(powDecimalhigh);
    ipQueryStartHigh=ipV6[0].subtract(modDecimalHigh);
    lowShift=lowLimitShift;
    BigDecimal highEndPlusDecimal=powDecimalhigh.subtract(endSubDecimalBase);
    ipQueryEndHigh=ipQueryStartHigh.add(highEndPlusDecimal);
  }
  BigDecimal powDecimalLow=powDecimalBase.pow(lowShift);
  BigDecimal modDecimalLow=ipV6[1].remainder(powDecimalLow);
  ipQueryStartLow=ipV6[1].subtract(modDecimalLow);
  BigDecimal lowEndPlusDecimal=powDecimalLow.subtract(endSubDecimalBase);
  ipQueryEndLow=ipQueryStartLow.add(lowEndPlusDecimal);
}
Program: 37501
Project: 37501
Buggy source:
/** 
 * check if IP v6 string is valid.
 * @param str IP string.
 * @return true if valid, false if not.
 */
public static boolean isIpV6StrValid(String str){
  final String regexV6="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Pattern pattern=Pattern.compile(regexV6);
  boolean isRegular=pattern.matcher(str).matches();
  return isRegular;
}

Fixed version (ground truth):
/** 
 * check if IP v6 string is valid.
 * @param str IP string.
 * @return true if valid, false if not.
 */
public static boolean isIpV6StrValid(String str){
  final String regexV6="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Pattern pattern=Pattern.compile(regexV6);
  boolean isRegular=pattern.matcher(str).matches();
  return isRegular;
}
Program: 37502
Project: 37502
Buggy source:
@Test public void testMain(){
  Init.main(null);
}

Fixed version (ground truth):
public void testMain(){
  Init.main(null);
}
Program: 37504
Project: 37504
Buggy source:
@Override public User IdentityCheckService(String userId,String userPwd){
  if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(userPwd)) {
    return null;
  }
  User user=idcDao.checkUserId(userId);
  if (MD5Encryption.encryption(userPwd).equalsIgnoreCase(user.getUserPwd())) {
    user.setUserType(User.UserType.Cerfications);
    return user;
  }
  return null;
}

Fixed version (ground truth):
@Override public User IdentityCheckService(String userId,String userPwd){
  if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(userPwd)) {
    return null;
  }
  User user=idcDao.checkUserId(userId);
  if (null == user) {
    return null;
  }
  if (MD5Encryption.encryption(userPwd).equalsIgnoreCase(user.getUserPwd())) {
    user.setUserType(User.UserType.Cerfications);
    return user;
  }
  return null;
}
Program: 37507
Project: 37507
Buggy source:
@Override public void init(FilterConfig arg0) throws ServletException {
  idcService=new IdentityCheckServiceImpl();
}

Fixed version (ground truth):
@Override public void init(FilterConfig arg0) throws ServletException {
}
Program: 37509
Project: 37509
Buggy source:
public User mapRow(ResultSet rs,int rowNum) throws SQLException {
  user.setUserId(rs.getLong("String_Node_Str"));
  user.setUserPwd(rs.getString("String_Node_Str"));
  return user;
}

Fixed version (ground truth):
public User mapRow(ResultSet rs,int rowNum) throws SQLException {
  User user=new User();
  user.setUserId(rs.getLong("String_Node_Str"));
  user.setUserPwd(rs.getString("String_Node_Str"));
  return user;
}
Program: 37510
Project: 37510
Buggy source:
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(sql);
  ps.setLong(1,Long.parseLong(userId));
  return ps;
}

Fixed version (ground truth):
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(sql);
  ps.setString(1,userId);
  return ps;
}
Program: 37511
Project: 37511
Buggy source:
@Override public User checkUserId(final String userId){
  List<User> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setLong(1,Long.parseLong(userId));
      return ps;
    }
  }
,new RowMapper<User>(){
    public User mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      user.setUserId(rs.getLong("String_Node_Str"));
      user.setUserPwd(rs.getString("String_Node_Str"));
      return user;
    }
  }
);
  return user;
}

Fixed version (ground truth):
@Override public User checkUserId(final String userId){
  List<User> result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,userId);
      return ps;
    }
  }
,new RowMapper<User>(){
    public User mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      User user=new User();
      user.setUserId(rs.getLong("String_Node_Str"));
      user.setUserPwd(rs.getString("String_Node_Str"));
      return user;
    }
  }
);
  if (null != result && result.size() > 0) {
    return result.get(0);
  }
  return null;
}
Program: 37512
Project: 37512
Buggy source:
@Override public User IdentityCheckService(String userId,String userPwd){
  user=idcDao.checkUserId(userId);
  if (userPwd.isEmpty()) {
    user.setUserType(User.UserType.Anonymous);
    return user;
  }
  if (MD5Encryption.encryption(userPwd).equalsIgnoreCase(user.getUserPwd())) {
    user.setUserType(User.UserType.Cerfications);
  }
 else {
    user.setUserType(User.UserType.Anonymous);
  }
  return user;
}

Fixed version (ground truth):
@Override public User IdentityCheckService(String userId,String userPwd){
  if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(userPwd)) {
    return null;
  }
  User user=idcDao.checkUserId(userId);
  if (MD5Encryption.encryption(userPwd).equalsIgnoreCase(user.getUserPwd())) {
    user.setUserType(User.UserType.Cerfications);
    return user;
  }
  return null;
}
Program: 37513
Project: 37513
Buggy source:
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  String tempPass=null;
  tempPass=request.getHeader("String_Node_Str");
  if (tempPass != null) {
    tempPass=tempPass.substring(6,tempPass.length());
    String tempPassdeCode="String_Node_Str";
    BASE64Decoder decoder=new BASE64Decoder();
    try {
      byte[] b=decoder.decodeBuffer(tempPass);
      tempPassdeCode=new String(b);
    }
 catch (    Exception e) {
      return;
    }
    String userReqId="String_Node_Str";
    String userReqPwd="String_Node_Str";
    userReqId=tempPassdeCode.substring(0,tempPassdeCode.indexOf("String_Node_Str"));
    userReqPwd=tempPassdeCode.substring(tempPassdeCode.indexOf("String_Node_Str") + 1);
    User user=null;
    IdentityCheckService idcService=ServiceBeanUtil.getIdentityCheckService();
    user=idcService.IdentityCheckService(userReqId,userReqPwd);
    if (null == user) {
      request.getSession().removeAttribute("String_Node_Str");
      writeError401Response(response);
      return;
    }
 else {
      request.getSession().setAttribute("String_Node_Str",user.getUserId());
    }
  }
  HttpSession session=request.getSession();
  Principal principal=Principal.getAnonymousPrincipal();
  if (null != session) {
    Object userId=session.getAttribute("String_Node_Str");
    if (null != userId) {
      principal=new Principal((Long)userId);
    }
  }
  PrincipalHolder.setPrincipal(principal);
  chain.doFilter(request,response);
  PrincipalHolder.remove();
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest arg0,ServletResponse arg1,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)arg0;
  HttpServletResponse response=(HttpServletResponse)arg1;
  String tempPass=null;
  tempPass=request.getHeader("String_Node_Str");
  Principal principal=Principal.getAnonymousPrincipal();
  if (tempPass != null) {
    tempPass=tempPass.substring(6,tempPass.length());
    String tempPassdeCode="String_Node_Str";
    BASE64Decoder decoder=new BASE64Decoder();
    try {
      byte[] b=decoder.decodeBuffer(tempPass);
      tempPassdeCode=new String(b);
    }
 catch (    Exception e) {
      return;
    }
    String userReqId="String_Node_Str";
    String userReqPwd="String_Node_Str";
    userReqId=tempPassdeCode.substring(0,tempPassdeCode.indexOf("String_Node_Str"));
    userReqPwd=tempPassdeCode.substring(tempPassdeCode.indexOf("String_Node_Str") + 1);
    User user=null;
    IdentityCheckService idcService=ServiceBeanUtil.getIdentityCheckService();
    user=idcService.IdentityCheckService(userReqId,userReqPwd);
    if (null == user) {
      request.getSession().removeAttribute("String_Node_Str");
      writeError401Response(response);
      return;
    }
 else {
      principal=new Principal(user.getUserId());
    }
  }
  PrincipalHolder.setPrincipal(principal);
  chain.doFilter(request,response);
  PrincipalHolder.remove();
}
Program: 37514
Project: 37514
Buggy source:
/** 
 * query nameserver by nameserver name.
 * @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){
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=DomainUtil.geneDomainPunyName(decodeNS);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  Nameserver ns=queryService.queryNameserver(queryParser.parseNameserverQueryParam(decodeNS,punyNSName));
  if (null != ns) {
    if (!accessControlManager.hasPermission(ns)) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(ns);
    return RestResponseUtil.createResponse200(ns);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * query nameserver by nameserver name.
 * @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){
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=decodeNS;
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  Nameserver ns=queryService.queryNameserver(queryParser.parseNameserverQueryParam(decodeNS,punyNSName));
  if (null != ns) {
    if (!accessControlManager.hasPermission(ns)) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(ns);
    return RestResponseUtil.createResponse200(ns);
  }
  return RestResponseUtil.createResponse404();
}
Program: 37516
Project: 37516
Buggy source:
/** 
 * convert ipV4 Long format to String.
 * @param longIp ipV4 long value.
 * @return ipv4 string.
 */
public static String longToIpV4(long longIp){
  if (longIp > 0xffffffff) {
    return "String_Node_Str";
  }
  final int threeByteSize=24;
  final int threeByteMask=0x00ffffff;
  final int twoByteSize=16;
  final int twoByteMask=0x0000ffff;
  final int oneByteSize=8;
  final int oneByteMask=0x000000ff;
  return String.format("String_Node_Str",longIp >>> threeByteSize,(longIp & threeByteMask) >>> twoByteSize,(longIp & twoByteMask) >>> oneByteSize,longIp & oneByteMask);
}

Fixed version (ground truth):
/** 
 * convert ipV4 Long format to String.
 * @param longIp ipV4 long value.
 * @return ipv4 string.
 */
public static String longToIpV4(long longIp){
  final long posShift=32;
  long tmp=longIp;
  tmp>>>=posShift;
  if (tmp > 0) {
    return "String_Node_Str";
  }
  final int threeByteSize=24;
  final int threeByteMask=0x00ffffff;
  final int twoByteSize=16;
  final int twoByteMask=0x0000ffff;
  final int oneByteSize=8;
  final int oneByteMask=0x000000ff;
  return String.format("String_Node_Str",longIp >>> threeByteSize,(longIp & threeByteMask) >>> twoByteSize,(longIp & twoByteMask) >>> oneByteSize,longIp & oneByteMask);
}
Program: 37517
Project: 37517
Buggy source:
/** 
 * convert ipV6 Long format to String.
 * @param highBits high 64 bits long value.
 * @param lowBits low 64 bits long value.
 * @return ipv6 string.
 */
public static String longToIpV6(long highBits,long lowBits){
  final long numBeyond=2 ^ 64 - 1;
  if (highBits > numBeyond || lowBits > numBeyond) {
    return "String_Node_Str";
  }
  final int oneByteSize=8;
  final int v6MaxSegment=8;
  final int twoByteSize=16;
  final int fourByteMask=0xFFFF;
  short[] shorts=new short[v6MaxSegment];
  String[] strings=new String[shorts.length];
  for (int i=0; i < v6MaxSegment; i++) {
    if (i >= 0 && i < v6MaxSegment / 2) {
      strings[i]=String.format("String_Node_Str",(short)(((highBits << i * twoByteSize) >>> twoByteSize * (oneByteSize - 1)) & fourByteMask));
    }
 else {
      strings[i]=String.format("String_Node_Str",(short)(((lowBits << i * twoByteSize) >>> twoByteSize * (oneByteSize - 1)) & fourByteMask));
    }
  }
  StringBuilder result=new StringBuilder();
  for (int i=0; i < strings.length; i++) {
    result.append(strings[i]);
    if (i < strings.length - 1) {
      result.append("String_Node_Str");
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * convert ipV6 Long format to String.
 * @param highBits high 64 bits long value.
 * @param lowBits low 64 bits long value.
 * @return ipv6 string.
 */
public static String longToIpV6(long highBits,long lowBits){
  final int oneByteSize=8;
  final int v6MaxSegment=8;
  final int twoByteSize=16;
  final int fourByteMask=0xFFFF;
  short[] shorts=new short[v6MaxSegment];
  String[] strings=new String[shorts.length];
  for (int i=0; i < v6MaxSegment; i++) {
    if (i >= 0 && i < v6MaxSegment / 2) {
      strings[i]=String.format("String_Node_Str",(short)(((highBits << i * twoByteSize) >>> twoByteSize * (oneByteSize - 1)) & fourByteMask));
    }
 else {
      strings[i]=String.format("String_Node_Str",(short)(((lowBits << i * twoByteSize) >>> twoByteSize * (oneByteSize - 1)) & fourByteMask));
    }
  }
  StringBuilder result=new StringBuilder();
  for (int i=0; i < strings.length; i++) {
    result.append(strings[i]);
    if (i < strings.length - 1) {
      result.append("String_Node_Str");
    }
  }
  return result.toString();
}
Program: 37518
Project: 37518
Buggy source:
/** 
 * test longToIpV4.
 */
@Test public void testLongToIpV4(){
  assertEquals("String_Node_Str",IpUtil.longToIpV4(16777216));
  assertEquals("String_Node_Str",IpUtil.longToIpV4(33554431));
}

Fixed version (ground truth):
/** 
 * test longToIpV4.
 */
@Test public void testLongToIpV4(){
  assertEquals("String_Node_Str",IpUtil.longToIpV4(16777216));
}
Program: 37519
Project: 37519
Buggy source:
/** 
 * convert ipV4 Long format to String.
 * @param longIp ipV4 long value.
 * @return ipv4 string.
 */
public static String longToIpV4(long longIp){
  final long posShift=32;
  long tmp=longIp;
  tmp>>>=posShift;
  if (tmp > 0) {
    return "String_Node_Str";
  }
  final int threeByteSize=24;
  final int threeByteMask=0x00ffffff;
  final int twoByteSize=16;
  final int twoByteMask=0x0000ffff;
  final int oneByteSize=8;
  final int oneByteMask=0x000000ff;
  return String.format("String_Node_Str",longIp >>> threeByteSize,(longIp & threeByteMask) >>> twoByteSize,(longIp & twoByteMask) >>> oneByteSize,longIp & oneByteMask);
}

Fixed version (ground truth):
/** 
 * convert ipV4 Long format to String.
 * @param longIp ipV4 long value.
 * @return ipv4 string.
 */
public static String longToIpV4(long longIp){
  final int threeByteSize=24;
  final int threeByteMask=0x00ffffff;
  final int twoByteSize=16;
  final int twoByteMask=0x0000ffff;
  final int oneByteSize=8;
  final int oneByteMask=0x000000ff;
  return String.format("String_Node_Str",(longIp >>> threeByteSize) & oneByteMask,(longIp & threeByteMask) >>> twoByteSize,(longIp & twoByteMask) >>> oneByteSize,longIp & oneByteMask);
}
Program: 37520
Project: 37520
Buggy source:
/** 
 * test longToIpV4.
 */
@Test public void testLongToIpV4(){
  assertEquals("String_Node_Str",IpUtil.longToIpV4(16777216));
}

Fixed version (ground truth):
/** 
 * test longToIpV4.
 */
@Test public void testLongToIpV4(){
  assertEquals("String_Node_Str",IpUtil.longToIpV4(16777216));
  assertEquals("String_Node_Str",IpUtil.longToIpV4(33554431));
  final long num=(0xffffffff);
  assertEquals("String_Node_Str",IpUtil.longToIpV4(num));
}
Program: 37521
Project: 37521
Buggy source:
/** 
 * encoded url use UTF-8.
 * @param str string.
 * @return String decoded string.
 */
private static String urlDecode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    result=URLDecoder.decode(str,StringUtil.CHAR_SET_UTF8);
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error(e.getMessage());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * decoded url use UTF-8.
 * @param str string.
 * @return String decoded string.
 */
private static String urlDecode(String str){
  if (StringUtils.isBlank(str)) {
    return str;
  }
  String result=str;
  try {
    result=URLDecoder.decode(str,StringUtil.CHAR_SET_UTF8);
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error(e.getMessage());
  }
  return result;
}
Program: 37526
Project: 37526
Buggy source:
/** 
 * test query exist autnum,with rdap+json type
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryExistAutnumWithRdapAndJson() throws Exception {
  String autnumStr="String_Node_Str";
  mockMvc.perform(get("String_Node_Str" + autnumStr).accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * test query exist autnum,with rdap+json type
 * @throws Exception
 */
@Test @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistAutnumWithRdapAndJson() throws Exception {
  String autnumStr="String_Node_Str";
  mockMvc.perform(get("String_Node_Str" + autnumStr).accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}
Program: 37527
Project: 37527
Buggy source:
/** 
 * test query exist autnum,with json type
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testQueryExistAutnum() throws Exception {
  String autnumStr="String_Node_Str";
  mockMvc.perform(get("String_Node_Str" + autnumStr).accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * test query exist autnum,with json type
 * @throws Exception
 */
@Test @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistAutnum() throws Exception {
  String autnumStr="String_Node_Str";
  mockMvc.perform(get("String_Node_Str" + autnumStr).accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str"));
}
Program: 37528
Project: 37528
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testSearchTruncatedDomain() throws Exception {
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItem("String_Node_Str"))).andExpect(jsonPath("String_Node_Str").value(true)).andExpect(jsonPath("String_Node_Str").exists()).andExpect(jsonPath("String_Node_Str").isArray()).andExpect(jsonPath("String_Node_Str",hasSize(5))).andExpect(jsonPath("String_Node_Str",Matchers.hasItem(Matchers.hasKey("String_Node_Str"))));
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testSearchTruncatedDomain() throws Exception {
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isOk()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItem("String_Node_Str"))).andExpect(jsonPath("String_Node_Str").value(true)).andExpect(jsonPath("String_Node_Str").exists()).andExpect(jsonPath("String_Node_Str").isArray()).andExpect(jsonPath("String_Node_Str",hasSize(5))).andExpect(jsonPath("String_Node_Str",Matchers.hasItem(Matchers.hasKey("String_Node_Str"))));
}
Program: 37529
Project: 37529
Buggy source:
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup("String_Node_Str") public void testSearchNonExistDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isNotFound()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItem("String_Node_Str"))).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").doesNotExist()).andExpect(jsonPath("String_Node_Str").doesNotExist());
}

Fixed version (ground truth):
/** 
 * test query exist domain.
 * @throws Exception
 */
@Test @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testSearchNonExistDomain() throws Exception {
  RestResponseUtil.initErrorMessages();
  mockMvc.perform(get(DOMAIN_SEARCH_URI + "String_Node_Str").accept(MediaType.parseMediaType("String_Node_Str"))).andExpect(status().isNotFound()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItem("String_Node_Str"))).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value("String_Node_Str")).andExpect(jsonPath("String_Node_Str").doesNotExist()).andExpect(jsonPath("String_Node_Str").doesNotExist());
}
Program: 37531
Project: 37531
Buggy source:
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistSecureDnsId=10000L;
  List<DsData> dsDataList=dsDataQueryDaoImpl.queryAsInnerObjects(nonExistSecureDnsId,ModelType.SECUREDNS);
  assertNotNull(dsDataList);
  assertEquals(dsDataList.size(),0);
}

Fixed version (ground truth):
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistSecureDnsId=10000L;
  List<DsData> dsDataList=dsDataQueryDaoImpl.queryAsInnerObjects(nonExistSecureDnsId,ModelType.SECUREDNS);
  assertNotNull(dsDataList);
  assertEquals(dsDataList.size(),0);
}
Program: 37532
Project: 37532
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryExistLink(){
  Long secureDnsId=1L;
  List<DsData> dsDataList=dsDataQueryDaoImpl.queryAsInnerObjects(secureDnsId,ModelType.SECUREDNS);
  assertNotNull(dsDataList);
  assertEquals(dsDataList.size(),1);
  DsData dsData=dsDataList.get(0);
  assertNotNull(dsData);
  assertEquals(dsData.getAlgorithm().intValue(),1);
  assertEquals(dsData.getDigest(),"String_Node_Str");
  assertEquals(dsData.getDigestType(),1);
  assertEquals(dsData.getKeyTag().intValue(),1);
  List<Link> links=dsData.getLinks();
  assertNotNull(links);
  assertEquals(1,links.size());
  Link link=links.get(0);
  assertNotNull(link);
  assertEquals("String_Node_Str",link.getValue());
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistLink(){
  Long secureDnsId=1L;
  List<DsData> dsDataList=dsDataQueryDaoImpl.queryAsInnerObjects(secureDnsId,ModelType.SECUREDNS);
  assertNotNull(dsDataList);
  assertEquals(dsDataList.size(),1);
  DsData dsData=dsDataList.get(0);
  assertNotNull(dsData);
  assertEquals(dsData.getAlgorithm().intValue(),1);
  assertEquals(dsData.getDigest(),"String_Node_Str");
  assertEquals(dsData.getDigestType(),1);
  assertEquals(dsData.getKeyTag().intValue(),1);
  List<Link> links=dsData.getLinks();
  assertNotNull(links);
  assertEquals(1,links.size());
  Link link=links.get(0);
  assertNotNull(link);
  assertEquals("String_Node_Str",link.getValue());
}
Program: 37533
Project: 37533
Buggy source:
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistSecureDnsId=10000L;
  List<KeyData> keyDataList=keyDataQueryDaoImpl.queryAsInnerObjects(nonExistSecureDnsId,ModelType.SECUREDNS);
  assertNotNull(keyDataList);
  assertEquals(keyDataList.size(),0);
}

Fixed version (ground truth):
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistSecureDnsId=10000L;
  List<KeyData> keyDataList=keyDataQueryDaoImpl.queryAsInnerObjects(nonExistSecureDnsId,ModelType.SECUREDNS);
  assertNotNull(keyDataList);
  assertEquals(keyDataList.size(),0);
}
Program: 37534
Project: 37534
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryExistLink(){
  Long secureDnsId=1L;
  List<KeyData> keyDataList=keyDataQueryDaoImpl.queryAsInnerObjects(secureDnsId,ModelType.SECUREDNS);
  assertNotNull(keyDataList);
  assertEquals(keyDataList.size(),1);
  KeyData keyData=keyDataList.get(0);
  assertNotNull(keyData);
  assertEquals(keyData.getAlgorithm().intValue(),1);
  assertEquals(keyData.getPublicKey(),"String_Node_Str");
  assertEquals(keyData.getProtocol().intValue(),1);
  assertEquals(keyData.getFlags().intValue(),1);
  List<Link> links=keyData.getLinks();
  assertNotNull(links);
  assertEquals(1,links.size());
  Link link=links.get(0);
  assertNotNull(link);
  assertEquals("String_Node_Str",link.getValue());
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistLink(){
  Long secureDnsId=1L;
  List<KeyData> keyDataList=keyDataQueryDaoImpl.queryAsInnerObjects(secureDnsId,ModelType.SECUREDNS);
  assertNotNull(keyDataList);
  assertTrue(keyDataList.size() >= 1);
  KeyData keyData=keyDataList.get(0);
  assertNotNull(keyData);
  assertEquals(keyData.getAlgorithm().intValue(),1);
  assertEquals(keyData.getPublicKey(),"String_Node_Str");
  assertEquals(keyData.getProtocol().intValue(),1);
  assertEquals(keyData.getFlags().intValue(),1);
  List<Link> links=keyData.getLinks();
  assertNotNull(links);
  assertEquals(1,links.size());
  Link link=links.get(0);
  assertNotNull(link);
  assertEquals("String_Node_Str",link.getValue());
}
Program: 37537
Project: 37537
Buggy source:
/** 
 * test query ont exist network.
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryNotExistNetwork(){
  Long nonExistDomainId=1000L;
  List<Network> networks=networkQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(networks);
  assertTrue(networks.size() == 0);
}

Fixed version (ground truth):
/** 
 * test query ont exist network.
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryNotExistNetwork(){
  Long nonExistDomainId=1000L;
  List<Network> networks=networkQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(networks);
  assertTrue(networks.size() == 0);
}
Program: 37538
Project: 37538
Buggy source:
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistDomainId=10000L;
  List<PublicId> publicIdsList=publicIdQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(publicIdsList);
  assertEquals(publicIdsList.size(),0);
}

Fixed version (ground truth):
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistDomainId=10000L;
  List<PublicId> publicIdsList=publicIdQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(publicIdsList);
  assertEquals(publicIdsList.size(),0);
}
Program: 37539
Project: 37539
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<PublicId> publicIdsList=publicIdQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(publicIdsList);
  assertEquals(publicIdsList.size(),1);
  PublicId publicId=publicIdsList.get(0);
  assertNotNull(publicId);
  assertEquals("String_Node_Str",publicId.getIdentifier());
  assertEquals("String_Node_Str",publicId.getType());
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<PublicId> publicIdsList=publicIdQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(publicIdsList);
  assertTrue(publicIdsList.size() >= 1);
  PublicId publicId=publicIdsList.get(0);
  assertNotNull(publicId);
  assertEquals("String_Node_Str",publicId.getIdentifier());
  assertEquals("String_Node_Str",publicId.getType());
}
Program: 37540
Project: 37540
Buggy source:
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistDomainId=10000L;
  List<SecureDns> secureDnsList=secureDnsQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(secureDnsList);
  assertEquals(0,secureDnsList.size());
}

Fixed version (ground truth):
/** 
 * test query non exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryNonExistEvent(){
  Long nonExistDomainId=10000L;
  List<SecureDns> secureDnsList=secureDnsQueryDao.queryAsInnerObjects(nonExistDomainId,ModelType.DOMAIN);
  assertNotNull(secureDnsList);
  assertEquals(0,secureDnsList.size());
}
Program: 37541
Project: 37541
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<SecureDns> secureDnsList=secureDnsQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(secureDnsList);
  assertEquals(1,secureDnsList.size());
  SecureDns secureDns=secureDnsList.get(0);
  assertNotNull(secureDns);
  assertEquals(1,secureDns.getMaxSigLife().intValue());
  assertEquals(true,secureDns.isDelegationSigned());
  assertEquals(true,secureDns.isZoneSigned());
  List<DsData> dsDataList=secureDns.getDsData();
  assertNotNull(dsDataList);
  assertEquals(1,dsDataList.size());
  DsData dsData=dsDataList.get(0);
  assertNotNull(dsData);
  assertEquals(dsData.getAlgorithm().intValue(),1);
  assertEquals("String_Node_Str",dsData.getDigest());
  assertEquals(1,dsData.getDigestType());
  assertEquals(1,dsData.getKeyTag().intValue());
  List<KeyData> keyDataList=secureDns.getKeyData();
  assertNotNull(keyDataList);
  assertEquals(1,keyDataList.size());
  KeyData keyData=keyDataList.get(0);
  assertNotNull(keyData);
  assertEquals(1,keyData.getAlgorithm().intValue());
  assertEquals("String_Node_Str",keyData.getPublicKey());
  assertEquals(1,keyData.getProtocol().intValue());
  assertEquals(1,keyData.getFlags().intValue());
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<SecureDns> secureDnsList=secureDnsQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(secureDnsList);
  assertEquals(1,secureDnsList.size());
  SecureDns secureDns=secureDnsList.get(0);
  assertNotNull(secureDns);
  assertEquals(1,secureDns.getMaxSigLife().intValue());
  assertEquals(true,secureDns.isDelegationSigned());
  assertEquals(true,secureDns.isZoneSigned());
  List<DsData> dsDataList=secureDns.getDsData();
  assertNotNull(dsDataList);
  assertEquals(1,dsDataList.size());
  DsData dsData=dsDataList.get(0);
  assertNotNull(dsData);
  assertEquals(dsData.getAlgorithm().intValue(),1);
  assertEquals("String_Node_Str",dsData.getDigest());
  assertEquals(1,dsData.getDigestType());
  assertEquals(1,dsData.getKeyTag().intValue());
  List<KeyData> keyDataList=secureDns.getKeyData();
  assertNotNull(keyDataList);
  assertEquals(1,keyDataList.size());
  KeyData keyData=keyDataList.get(0);
  assertNotNull(keyData);
  assertEquals(1,keyData.getAlgorithm().intValue());
  assertEquals("String_Node_Str",keyData.getPublicKey());
  assertEquals(1,keyData.getProtocol().intValue());
  assertEquals(1,keyData.getFlags().intValue());
}
Program: 37542
Project: 37542
Buggy source:
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup("String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<Variants> variantsList=variantsQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(variantsList);
  assertEquals(variantsList.size(),1);
  Variants variants=variantsList.get(0);
  assertNotNull(variants);
  List<Variant> variantList=variants.getVariantNames();
  assertNotNull(variantList);
  assertEquals(variantList.size(),1);
  Variant variant=variantList.get(0);
  assertNotNull(variant);
  assertEquals(variant.getLdhName(),"String_Node_Str");
  assertEquals(variant.getUnicodeName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * test query exist event
 */
@Test @DatabaseTearDown("String_Node_Str") @DatabaseSetup(type=DatabaseOperation.REFRESH,value="String_Node_Str") public void testQueryExistLink(){
  Long domainId=1L;
  List<Variants> variantsList=variantsQueryDao.queryAsInnerObjects(domainId,ModelType.DOMAIN);
  assertNotNull(variantsList);
  assertEquals(variantsList.size(),1);
  Variants variants=variantsList.get(0);
  assertNotNull(variants);
  List<Variant> variantList=variants.getVariantNames();
  assertNotNull(variantList);
  assertEquals(variantList.size(),1);
  Variant variant=variantList.get(0);
  assertNotNull(variant);
  assertEquals(variant.getLdhName(),"String_Node_Str");
  assertEquals(variant.getUnicodeName(),"String_Node_Str");
}
Program: 37543
Project: 37543
Buggy source:
/** 
 * query nameserver by nameserver name.
 * @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){
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=decodeNS;
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  Nameserver ns=queryService.queryNameserver(queryParser.parseNameserverQueryParam(decodeNS,punyNSName));
  if (null != ns) {
    if (!accessControlManager.hasPermission(ns)) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(ns);
    return RestResponseUtil.createResponse200(ns);
  }
  return RestResponseUtil.createResponse404();
}

Fixed version (ground truth):
/** 
 * query nameserver by nameserver name.
 * @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){
  String decodeNS=nameserverName;
  String punyNSName=decodeNS;
  try {
    decodeNS=DomainUtil.decodeAndTrimAndReplaceAsciiToLowercase(nameserverName);
    punyNSName=DomainUtil.geneDomainPunyName(decodeNS);
  }
 catch (  Exception e) {
    return RestResponseUtil.createResponse400();
  }
  if (!DomainUtil.validateDomainNameIsValidIdna(decodeNS)) {
    return RestResponseUtil.createResponse400();
  }
  decodeNS=DomainUtil.deleteLastPoint(decodeNS);
  decodeNS=StringUtils.lowerCase(decodeNS);
  Nameserver ns=queryService.queryNameserver(queryParser.parseNameserverQueryParam(decodeNS,punyNSName));
  if (null != ns) {
    if (!accessControlManager.hasPermission(ns)) {
      return RestResponseUtil.createResponse403();
    }
    responseDecorator.decorateResponse(ns);
    return RestResponseUtil.createResponse200(ns);
  }
  return RestResponseUtil.createResponse404();
}
Program: 37546
Project: 37546
Buggy source:
/** 
 * generate DomainQueryParam.
 * @param domainName domain name.
 * @param punyDomainName domain puny name.
 * @return QueryParam.
 */
public QueryParam parseDomainQueryParam(String domainName,String punyDomainName){
  String punyName=DomainUtil.geneDomainPunyName(domainName);
  return new DomainQueryParam(domainName,punyName);
}

Fixed version (ground truth):
/** 
 * generate DomainQueryParam.
 * @param domainName domain name.
 * @param punyDomainName domain puny name.
 * @return QueryParam.
 */
public QueryParam parseDomainQueryParam(String domainName,String punyDomainName){
  return new DomainQueryParam(domainName,punyDomainName);
}
Program: 37547
Project: 37547
Buggy source:
/** 
 * generate NameserverQueryParam.
 * @param nsName nameserver name.
 * @param punyNSName nameserver puny name.
 * @return QueryParam.
 */
public QueryParam parseNameserverQueryParam(String nsName,String punyNSName){
  String punyName=DomainUtil.geneDomainPunyName(nsName);
  return new NameserverQueryParam(nsName,punyName);
}

Fixed version (ground truth):
/** 
 * generate NameserverQueryParam.
 * @param nsName nameserver name.
 * @param punyNSName nameserver puny name.
 * @return QueryParam.
 */
public QueryParam parseNameserverQueryParam(String nsName,String punyNSName){
  return new NameserverQueryParam(nsName,punyNSName);
}
Program: 37548
Project: 37548
Buggy source:
@Override public List<Nameserver> queryAsInnerObjects(Long outerObjectId,ModelType outerModelType){
  List<Nameserver> listNameserver=queryNameserverWithDomainID(outerObjectId,outerModelType);
  final int sizeNameserver=listNameserver.size();
  for (int i=0; i < sizeNameserver; ++i) {
    queryAndSetInnerObjects(listNameserver.get(i));
  }
  return listNameserver;
}

Fixed version (ground truth):
@Override public List<Nameserver> queryAsInnerObjects(Long outerObjectId,ModelType outerModelType){
  List<Nameserver> listNameserver=queryNameserverWithDomainID(outerObjectId,outerModelType);
  if (listNameserver == null)   return null;
  final int sizeNameserver=listNameserver.size();
  for (int i=0; i < sizeNameserver; ++i) {
    queryAndSetInnerObjects(listNameserver.get(i));
  }
  return listNameserver;
}
Program: 37549
Project: 37549
Buggy source:
/** 
 * validate domain puny name is valid idna.
 * @param domainName domain name,ASCII char MUST in lower case.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!isArpaTldAndLabelIsValid(domainName)) {
    return false;
  }
  String punyDomainName=domainName;
  try {
    punyDomainName=geneDomainPunyName(domainName);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
    return false;
  }
  String domainWithoutLastPoint=deleteLastPoint(punyDomainName);
  String[] splits=StringUtils.split(domainWithoutLastPoint,"String_Node_Str");
  if (splits.length > MAX_DOMAIN_LABEL) {
    return false;
  }
  if (domainName.equals(punyDomainName)) {
    if (isLdh(domainName)) {
      return true;
    }
 else {
      return false;
    }
  }
  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.
 * @return true if is valid idna,false if not.
 */
public static boolean validateDomainNameIsValidIdna(String domainName){
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  if (!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)) {
    if (isLdh(domainName)) {
      return true;
    }
 else {
      return false;
    }
  }
  domainName=deleteLastPoint(domainName);
  if (StringUtils.isBlank(domainName) || !domainName.contains("String_Node_Str")) {
    return false;
  }
  return IdnaUtil.isValidIdn(domainName);
}