nus-yam/ex-repair huggingface dataset:
Program: 37136
Project: 37136
Buggy source:
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(SQL_SAVE_IP,Statement.RETURN_GENERATED_KEYS);
  ps.setString(1,model.getHandle());
  ps.setBytes(2,IpUtil.ipToByteArray(model.getEndAddress(),model.getIpVersion()));
  ps.setBytes(3,IpUtil.ipToByteArray(model.getStartAddress(),model.getIpVersion()));
  ps.setString(4,model.getIpVersion().getName());
  ps.setString(5,model.getName());
  ps.setString(6,model.getType());
  ps.setString(7,model.getCountry());
  ps.setString(8,model.getParentHandle());
  ps.setString(9,model.getPort43());
  ps.setString(10,model.getLang());
  ps.setString(11,model.getCidr());
  ps.setString(12,model.getCustomPropertiesJsonVal());
  return ps;
}

Fixed version (ground truth):
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(SQL_SAVE_IP,Statement.RETURN_GENERATED_KEYS);
  ps.setString(1,model.getHandle());
  ps.setBytes(2,IpUtil.ipToByteArray(model.getEndAddress()));
  ps.setBytes(3,IpUtil.ipToByteArray(model.getStartAddress()));
  ps.setString(4,model.getIpVersion().getName());
  ps.setString(5,model.getName());
  ps.setString(6,model.getType());
  ps.setString(7,model.getCountry());
  ps.setString(8,model.getParentHandle());
  ps.setString(9,model.getPort43());
  ps.setString(10,model.getLang());
  ps.setString(11,model.getCidr());
  ps.setString(12,model.getCustomPropertiesJsonVal());
  return ps;
}
Program: 37137
Project: 37137
Buggy source:
@Override public Network save(final Network model){
  KeyHolder keyHolder=new GeneratedKeyHolder();
  jdbcTemplate.update(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(SQL_SAVE_IP,Statement.RETURN_GENERATED_KEYS);
      ps.setString(1,model.getHandle());
      ps.setBytes(2,IpUtil.ipToByteArray(model.getEndAddress(),model.getIpVersion()));
      ps.setBytes(3,IpUtil.ipToByteArray(model.getStartAddress(),model.getIpVersion()));
      ps.setString(4,model.getIpVersion().getName());
      ps.setString(5,model.getName());
      ps.setString(6,model.getType());
      ps.setString(7,model.getCountry());
      ps.setString(8,model.getParentHandle());
      ps.setString(9,model.getPort43());
      ps.setString(10,model.getLang());
      ps.setString(11,model.getCidr());
      ps.setString(12,model.getCustomPropertiesJsonVal());
      return ps;
    }
  }
,keyHolder);
  model.setId(keyHolder.getKey().longValue());
  return model;
}

Fixed version (ground truth):
@Override public Network save(final Network model){
  KeyHolder keyHolder=new GeneratedKeyHolder();
  jdbcTemplate.update(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(SQL_SAVE_IP,Statement.RETURN_GENERATED_KEYS);
      ps.setString(1,model.getHandle());
      ps.setBytes(2,IpUtil.ipToByteArray(model.getEndAddress()));
      ps.setBytes(3,IpUtil.ipToByteArray(model.getStartAddress()));
      ps.setString(4,model.getIpVersion().getName());
      ps.setString(5,model.getName());
      ps.setString(6,model.getType());
      ps.setString(7,model.getCountry());
      ps.setString(8,model.getParentHandle());
      ps.setString(9,model.getPort43());
      ps.setString(10,model.getLang());
      ps.setString(11,model.getCidr());
      ps.setString(12,model.getCustomPropertiesJsonVal());
      return ps;
    }
  }
,keyHolder);
  model.setId(keyHolder.getKey().longValue());
  return model;
}
Program: 37138
Project: 37138
Buggy source:
@Override public void update(final Network model){
  jdbcTemplate.update(SQL_UPDATE_IP,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setBytes(1,IpUtil.ipToByteArray(model.getEndAddress(),model.getIpVersion()));
      ps.setBytes(2,IpUtil.ipToByteArray(model.getStartAddress(),model.getIpVersion()));
      ps.setString(3,model.getIpVersion().getName());
      ps.setString(4,model.getName());
      ps.setString(5,model.getType());
      ps.setString(6,model.getCountry());
      ps.setString(7,model.getParentHandle());
      ps.setString(8,model.getPort43());
      ps.setString(9,model.getLang());
      ps.setString(10,model.getCidr());
      ps.setString(11,model.getCustomPropertiesJsonVal());
      ps.setLong(12,model.getId());
    }
  }
);
}

Fixed version (ground truth):
@Override public void update(final Network model){
  jdbcTemplate.update(SQL_UPDATE_IP,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setBytes(1,IpUtil.ipToByteArray(model.getEndAddress()));
      ps.setBytes(2,IpUtil.ipToByteArray(model.getStartAddress()));
      ps.setString(3,model.getIpVersion().getName());
      ps.setString(4,model.getName());
      ps.setString(5,model.getType());
      ps.setString(6,model.getCountry());
      ps.setString(7,model.getParentHandle());
      ps.setString(8,model.getPort43());
      ps.setString(9,model.getLang());
      ps.setString(10,model.getCidr());
      ps.setString(11,model.getCustomPropertiesJsonVal());
      ps.setLong(12,model.getId());
    }
  }
);
}
Program: 37139
Project: 37139
Buggy source:
/** 
 * parseTelephoneTypes.
 * @param typesStr types String, split by ';'.
 * @return TelephoneType list.
 */
private List<TelephoneType> parseTelephoneTypes(String typesStr){
  List<TelephoneType> types=new ArrayList<TelephoneType>();
  String[] typeSplitStrArray=StringUtils.split(typesStr,"String_Node_Str");
  for (  String typeSplit : typeSplitStrArray) {
    TelephoneType type=TelephoneType.find(typeSplit);
    if (null != type) {
      types.add(type);
    }
  }
  return types;
}

Fixed version (ground truth):
/** 
 * parseTelephoneTypes.
 * @param typesStr types String, split by ';'.
 * @return TelephoneType list.
 */
private List<TelephoneType> parseTelephoneTypes(String typesStr){
  List<TelephoneType> types=new ArrayList<TelephoneType>();
  String[] typeSplitStrArray=StringUtils.split(typesStr,"String_Node_Str");
  if (null == typeSplitStrArray) {
    return types;
  }
  for (  String typeSplit : typeSplitStrArray) {
    TelephoneType type=TelephoneType.find(typeSplit);
    if (null != type) {
      types.add(type);
    }
  }
  return types;
}
Program: 37140
Project: 37140
Buggy source:
@Override protected void execute(Entity entity){
  LOGGER.debug("String_Node_Str");
  getDao().update(entity);
  LOGGER.debug("String_Node_Str");
  getDao().updateStatus(entity);
  EntityDto dto=(EntityDto)entity.getDto();
  updateEntityAddresses(entity);
  updateEntitiesRel(entity);
  updatePublicIds(dto.getPublicIds(),entity);
  updateBaseModel(entity);
}

Fixed version (ground truth):
@Override protected void execute(Entity entity){
  LOGGER.debug("String_Node_Str");
  getDao().update(entity);
  LOGGER.debug("String_Node_Str");
  getDao().updateStatus(entity);
  EntityDto dto=(EntityDto)entity.getDto();
  updateEntityAddresses(entity);
  updateEntityTels(entity);
  updatePublicIds(dto.getPublicIds(),entity);
  updateBaseModel(entity);
}
Program: 37141
Project: 37141
Buggy source:
public static void checkValidAndMinMaxDate(String dateString,Date minValue,Date maxValue,String fieldName,ValidationResult validationResult){
  if (StringUtils.isEmpty(dateString)) {
    return;
  }
  Date dateValue=DateUtil.parseUTC(dateString);
  if (null == dateValue) {
    validationResult.addError(UpdateValidationError.build4008Error(fieldName));
    return;
  }
  checkMinMaxDate(dateValue,minValue,maxValue,fieldName,validationResult);
}

Fixed version (ground truth):
public static void checkValidAndMinMaxDate(String dateString,Date minValue,Date maxValue,String fieldName,ValidationResult validationResult){
  if (StringUtils.isEmpty(dateString)) {
    return;
  }
  Date dateValue=DateUtil.parseUTC(dateString);
  if (null == dateValue) {
    validationResult.addError(UpdateValidationError.build4007Error(fieldName));
    return;
  }
  checkMinMaxDate(dateValue,minValue,maxValue,fieldName,validationResult);
}
Program: 37142
Project: 37142
Buggy source:
@Test @DatabaseSetup("String_Node_Str") @DatabaseTearDown("String_Node_Str") public void test_invalid_event_date() throws Exception {
  DomainDto domain=generateDomainDto();
  List<EventDto> events=new ArrayList<EventDto>();
  domain.setEvents(events);
  EventDto event=new EventDto();
  events.add(event);
  event.setEventAction("String_Node_Str");
  event.setEventActor("String_Node_Str");
  event.setEventDate("String_Node_Str");
  String content=JsonHelper.serialize(domain);
  mockMvc.perform(post(URI_DOMAIN_U).contentType(MediaType.parseMediaType(rdapJson)).content(content)).andExpect(status().isBadRequest()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4008)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4008.getMessage(),"String_Node_Str"))));
}

Fixed version (ground truth):
@Test @DatabaseSetup("String_Node_Str") @DatabaseTearDown("String_Node_Str") public void test_invalid_event_date() throws Exception {
  DomainDto domain=generateDomainDto();
  List<EventDto> events=new ArrayList<EventDto>();
  domain.setEvents(events);
  EventDto event=new EventDto();
  events.add(event);
  event.setEventAction("String_Node_Str");
  event.setEventActor("String_Node_Str");
  event.setEventDate("String_Node_Str");
  String content=JsonHelper.serialize(domain);
  mockMvc.perform(post(URI_DOMAIN_U).contentType(MediaType.parseMediaType(rdapJson)).content(content)).andExpect(status().isBadRequest()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4007)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4007.getMessage(),"String_Node_Str"))));
}
Program: 37143
Project: 37143
Buggy source:
/** 
 * check if mediaTypes contains supported media type.
 * @param mediaTypes mediaTypes.
 * @return true if contain, false if not.
 */
private boolean containsSupportedMediaType(List<MediaType> mediaTypes){
  LOGGER.debug("String_Node_Str",SUPPORTED_MEDIA_TYPE);
  for (  MediaType supportedMediaType : SUPPORTED_MEDIA_TYPE) {
    for (    MediaType mediaType : SUPPORTED_MEDIA_TYPE) {
      if (StringUtils.equalsIgnoreCase(supportedMediaType.getType(),mediaType.getType()) && StringUtils.equalsIgnoreCase(supportedMediaType.getSubtype(),mediaType.getSubtype())) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * check if mediaTypes contains supported media type.
 * @param mediaTypes mediaTypes.
 * @return true if contain, false if not.
 */
private boolean containsSupportedMediaType(List<MediaType> mediaTypes){
  LOGGER.debug("String_Node_Str",SUPPORTED_MEDIA_TYPE);
  for (  MediaType supportedMediaType : SUPPORTED_MEDIA_TYPE) {
    for (    MediaType mediaType : mediaTypes) {
      if (StringUtils.equalsIgnoreCase(supportedMediaType.getType(),mediaType.getType()) && StringUtils.equalsIgnoreCase(supportedMediaType.getSubtype(),mediaType.getSubtype())) {
        return true;
      }
    }
  }
  return false;
}
Program: 37144
Project: 37144
Buggy source:
private void checkVariants(DomainDto domainDto,ValidationResult validationResult){
  List<VariantDto> variants=domainDto.getVariants();
  if (null == variants) {
    return;
  }
  for (  VariantDto variant : variants) {
    checkMaxLength(variant.getIdnTable(),MAX_LENGTH_255,"String_Node_Str",validationResult);
    List<String> relations=variant.getRelation();
    if (null != relations) {
      for (      String relation : relations) {
        checkMaxLength(relation,MAX_LENGTH_255,"String_Node_Str",validationResult);
      }
    }
    List<VariantNameDto> variantNames=variant.getVariantNames();
    if (null != variantNames) {
      for (      VariantNameDto variantName : variantNames) {
        checkNotEmptyAndMaxLength(variantName.getLdhName(),MAX_LENGTH_HANDLE,"String_Node_Str",validationResult);
        checkNotEmptyAndMaxLength(variantName.getUnicodeName(),MAX_LENGTH_UNICODENAME,"String_Node_Str",validationResult);
      }
    }
  }
}

Fixed version (ground truth):
private void checkVariants(DomainDto domainDto,ValidationResult validationResult){
  List<VariantDto> variants=domainDto.getVariants();
  if (null == variants) {
    return;
  }
  for (  VariantDto variant : variants) {
    checkMaxLength(variant.getIdnTable(),MAX_LENGTH_255,"String_Node_Str",validationResult);
    List<String> relations=variant.getRelation();
    if (null != relations) {
      for (      String relation : relations) {
        checkMaxLength(relation,MAX_LENGTH_255,"String_Node_Str",validationResult);
      }
    }
    List<VariantNameDto> variantNames=variant.getVariantNames();
    if (null != variantNames) {
      for (      VariantNameDto variantName : variantNames) {
        checkNotEmptyAndMaxLength(variantName.getLdhName(),MAX_LENGTH_LDHNAME,"String_Node_Str",validationResult);
        checkNotEmptyAndMaxLength(variantName.getUnicodeName(),MAX_LENGTH_UNICODENAME,"String_Node_Str",validationResult);
      }
    }
  }
}
Program: 37145
Project: 37145
Buggy source:
/** 
 * set network id to domain.
 * @param dto DTO.
 * @param domain domain.
 */
private void convertNetworkIdIfExist(DomainDto dto,Domain domain){
  if (!DomainType.ARPA.equals(DomainType.getByTypeName(dto.getType()))) {
    return;
  }
  if (StringUtils.isBlank(dto.getNetworkHandle())) {
    return;
  }
  Long networkId=networkDao.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: 37146
Project: 37146
Buggy source:
@Test @DatabaseSetup("String_Node_Str") @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(delete(URI_DOMAIN_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson))).andExpect(status().isBadRequest()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}

Fixed version (ground truth):
@Test @DatabaseSetup("String_Node_Str") @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(delete(URI_DOMAIN_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson))).andExpect(status().isNotFound()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}
Program: 37147
Project: 37147
Buggy source:
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(put(URI_DOMAIN_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson)).content("String_Node_Str")).andExpect(status().isBadRequest()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}

Fixed version (ground truth):
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(put(URI_DOMAIN_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson)).content("String_Node_Str")).andExpect(status().isNotFound()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}
Program: 37148
Project: 37148
Buggy source:
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(delete(URI_NS_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson))).andExpect(status().isBadRequest()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}

Fixed version (ground truth):
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(delete(URI_NS_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson))).andExpect(status().isNotFound()).andExpect(content().contentType("String_Node_Str")).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}
Program: 37149
Project: 37149
Buggy source:
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(put(URI_NS_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson)).content("String_Node_Str")).andExpect(status().isBadRequest()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(400)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}

Fixed version (ground truth):
@Test @DatabaseTearDown("String_Node_Str") public void test_invalid_handle_not_exist() throws Exception {
  String notExistHandle="String_Node_Str";
  mockMvc.perform(put(URI_NS_U + notExistHandle).contentType(MediaType.parseMediaType(rdapJson)).content("String_Node_Str")).andExpect(status().isNotFound()).andExpect(content().contentType(rdapJson)).andExpect(jsonPath("String_Node_Str").value(404)).andExpect(jsonPath("String_Node_Str").value(4041)).andExpect(jsonPath("String_Node_Str").value(CoreMatchers.hasItems(String.format(ServiceErrorCode.ERROR_4041.getMessage(),notExistHandle))));
}
Program: 37150
Project: 37150
Buggy source:
public String excute(String param,HttpMethodType httpMethod,ObjectType objectType) throws Exception {
  URL url=new URL(makeUrl(objectType));
  URLConnection urlConnection=url.openConnection();
  HttpURLConnection httpURLConnection=(HttpURLConnection)urlConnection;
  httpURLConnection.setConnectTimeout(connectTimeout);
  httpURLConnection.setReadTimeout(readTimeout);
  httpURLConnection.setDoInput(true);
  if (!httpMethod.equals(HttpMethodType.PUT)) {
    httpURLConnection.setDoOutput(true);
    httpURLConnection.setInstanceFollowRedirects(false);
  }
 else {
    httpURLConnection.setDoOutput(false);
    httpURLConnection.setInstanceFollowRedirects(true);
  }
  httpURLConnection.setUseCaches(false);
  httpURLConnection.setRequestMethod(httpMethod.name());
  httpURLConnection.setRequestProperty("String_Node_Str",MEDIA_TYPE);
  httpURLConnection.connect();
  httpURLConnection.getOutputStream().write(param.getBytes());
  if (httpURLConnection.getResponseCode() != 200) {
  }
  BufferedReader reader=new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
  StringBuilder sb=new StringBuilder();
  String line;
  while ((line=reader.readLine()) != null) {
    sb.append(line);
  }
  return sb.toString();
}

Fixed version (ground truth):
public String excute(String param,HttpMethodType httpMethod,ObjectType objectType) throws Exception {
  URL url=new URL(makeUrl(objectType));
  URLConnection urlConnection=url.openConnection();
  HttpURLConnection httpURLConnection=(HttpURLConnection)urlConnection;
  httpURLConnection.setConnectTimeout(connectTimeout);
  httpURLConnection.setReadTimeout(readTimeout);
  httpURLConnection.setDoInput(true);
  if (!httpMethod.equals(HttpMethodType.PUT)) {
    httpURLConnection.setDoOutput(true);
    httpURLConnection.setInstanceFollowRedirects(false);
  }
 else {
    httpURLConnection.setDoOutput(false);
    httpURLConnection.setInstanceFollowRedirects(true);
  }
  httpURLConnection.setUseCaches(false);
  httpURLConnection.setRequestMethod(httpMethod.name());
  httpURLConnection.setRequestProperty("String_Node_Str",MEDIA_TYPE);
  httpURLConnection.connect();
  OutputStream out=httpURLConnection.getOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(out,"String_Node_Str"));
  writer.write(param);
  writer.flush();
  writer.close();
  out.close();
  if (httpURLConnection.getResponseCode() != 200) {
  }
  BufferedReader reader=new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
  StringBuilder sb=new StringBuilder();
  String line;
  while ((line=reader.readLine()) != null) {
    sb.append(line);
  }
  return sb.toString();
}
Program: 37151
Project: 37151
Buggy source:
@Test public void test_invalid_variant_ldhName_exceedMaxLength() throws Exception {
  DomainDto dto=generateDomainDto();
  List<VariantDto> variantDto=new ArrayList<VariantDto>();
  dto.setVariants(variantDto);
  VariantDto v=new VariantDto();
  v.setIdnTable("String_Node_Str");
  variantDto.add(v);
  String stringExceedOneMoreChar=createStringWithLength(UpdateValidateUtil.MAX_LENGTH_HANDLE + 1);
  List<VariantNameDto> variantNames=new ArrayList<VariantNameDto>();
  VariantNameDto name=new VariantNameDto();
  variantNames.add(name);
  name.setLdhName(stringExceedOneMoreChar);
  v.setVariantNames(variantNames);
  UpdateResponse response=createService.execute(dto);
  assertNotNull(response);
  assertEquals(400,response.getErrorCode());
  assertEquals(4003,response.getSubErrorCode());
}

Fixed version (ground truth):
@Test public void test_invalid_variant_ldhName_exceedMaxLength() throws Exception {
  DomainDto dto=generateDomainDto();
  List<VariantDto> variantDto=new ArrayList<VariantDto>();
  dto.setVariants(variantDto);
  VariantDto v=new VariantDto();
  v.setIdnTable("String_Node_Str");
  variantDto.add(v);
  String stringExceedOneMoreChar=createStringWithLength(UpdateValidateUtil.MAX_LENGTH_LDHNAME + 1);
  List<VariantNameDto> variantNames=new ArrayList<VariantNameDto>();
  VariantNameDto name=new VariantNameDto();
  variantNames.add(name);
  name.setLdhName(stringExceedOneMoreChar);
  v.setVariantNames(variantNames);
  UpdateResponse response=createService.execute(dto);
  assertNotNull(response);
  assertEquals(400,response.getErrorCode());
  assertEquals(4003,response.getSubErrorCode());
}
Program: 37152
Project: 37152
Buggy source:
@Override public void update(final Domain model){
  jdbcTemplate.update(SQL_UPDATE_DOMAIN,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setString(1,model.getLdhName());
      ps.setString(2,model.getUnicodeName());
      ps.setString(3,model.getPort43());
      ps.setString(4,model.getLang());
      ps.setObject(5,model.getNetworkId());
      ps.setString(6,model.getCustomPropertiesJsonVal());
    }
  }
);
}

Fixed version (ground truth):
@Override public void update(final Domain model){
  jdbcTemplate.update(SQL_UPDATE_DOMAIN,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setString(1,model.getLdhName());
      ps.setString(2,model.getUnicodeName());
      ps.setString(3,model.getPort43());
      ps.setString(4,model.getLang());
      ps.setObject(5,model.getNetworkId());
      ps.setString(6,model.getCustomPropertiesJsonVal());
      ps.setLong(7,model.getId());
    }
  }
);
}
Program: 37153
Project: 37153
Buggy source:
@Override public void update(final Nameserver model){
  jdbcTemplate.update(SQL_UPDATE_NAMESERVER,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setString(1,model.getLdhName());
      ps.setString(2,model.getUnicodeName());
      ps.setString(3,model.getPort43());
      ps.setString(4,model.getLang());
      ps.setString(5,model.getCustomPropertiesJsonVal());
    }
  }
);
}

Fixed version (ground truth):
@Override public void update(final Nameserver model){
  jdbcTemplate.update(SQL_UPDATE_NAMESERVER,new PreparedStatementSetter(){
    public void setValues(    PreparedStatement ps) throws SQLException {
      ps.setString(1,model.getLdhName());
      ps.setString(2,model.getUnicodeName());
      ps.setString(3,model.getPort43());
      ps.setString(4,model.getLang());
      ps.setString(5,model.getCustomPropertiesJsonVal());
      ps.setLong(6,model.getId());
    }
  }
);
}
Program: 37154
Project: 37154
Buggy source:
/** 
 * do pre process request method.
 * @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 {
  boolean httpMethodIsValid=httpMethodIsValid(request);
  LOGGER.debug("String_Node_Str",httpMethodIsValid);
  if (!httpMethodIsValid) {
    ResponseEntity<ErrorMessage> responseEntity=RestResponse.createResponse405();
    FilterHelper.writeResponse(responseEntity,response);
    return false;
  }
  boolean mediaTypeIsValid=mediaTypeIsValid(request);
  LOGGER.debug("String_Node_Str",mediaTypeIsValid);
  if (!mediaTypeIsValid) {
    ResponseEntity<ErrorMessage> responseEntity=RestResponse.createResponse415();
    FilterHelper.writeResponse(responseEntity,response);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * do pre process request method.
 * @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 {
  boolean httpMethodIsValid=httpMethodIsValid(request);
  LOGGER.debug("String_Node_Str",httpMethodIsValid);
  if (!httpMethodIsValid) {
    ResponseEntity<ErrorMessage> responseEntity=RestResponse.createResponse405();
    FilterHelper.writeResponse(responseEntity,response);
    return false;
  }
  if (FilterHelper.isUpdateUri(request)) {
    boolean contentTypeValid=checkContentTypeForUpdate(request);
    if (!contentTypeValid) {
      ResponseEntity<ErrorMessage> responseEntity=RestResponse.createResponse415();
      FilterHelper.writeResponse(responseEntity,response);
      return contentTypeValid;
    }
    return true;
  }
  boolean mediaTypeIsValid=mediaTypeIsValid(request);
  LOGGER.debug("String_Node_Str",mediaTypeIsValid);
  if (!mediaTypeIsValid) {
    ResponseEntity<ErrorMessage> responseEntity=RestResponse.createResponse415();
    FilterHelper.writeResponse(responseEntity,response);
    return false;
  }
  return true;
}
Program: 37155
Project: 37155
Buggy source:
private void assertDomain(String updateLdhName,String updateLang,String originalHandle,String updatePort43) throws Exception {
  List<Map<?,?>> resultList=getTableDataForSql("String_Node_Str","String_Node_Str");
  assertTrue(resultList.size() > 0);
  Map<?,?> actualDomain=resultList.get(0);
  assertEquals(originalHandle,actualDomain.get("String_Node_Str"));
  assertEquals(DomainType.DNR.getName(),actualDomain.get("String_Node_Str"));
  assertEquals(updateLdhName,actualDomain.get("String_Node_Str"));
  assertEquals(updateLdhName,actualDomain.get("String_Node_Str"));
  assertEquals(updateLang,actualDomain.get("String_Node_Str"));
  assertEquals(updatePort43,actualDomain.get("String_Node_Str"));
  assertEquals("String_Node_Str",actualDomain.get("String_Node_Str"));
}

Fixed version (ground truth):
private void assertDomain(String updateLdhName,String updateLang,String originalHandle,String updatePort43,String customPropertiesStr) throws Exception {
  List<Map<?,?>> resultList=getTableDataForSql("String_Node_Str","String_Node_Str" + originalHandle + "String_Node_Str");
  assertTrue(resultList.size() > 0);
  Map<?,?> actualDomain=resultList.get(0);
  assertEquals(originalHandle,actualDomain.get("String_Node_Str"));
  assertEquals(DomainType.DNR.getName(),actualDomain.get("String_Node_Str"));
  assertEquals(updateLdhName,actualDomain.get("String_Node_Str"));
  assertEquals(updateLdhName,actualDomain.get("String_Node_Str"));
  assertEquals(updateLang,actualDomain.get("String_Node_Str"));
  assertEquals(updatePort43,actualDomain.get("String_Node_Str"));
  assertEquals(customPropertiesStr,actualDomain.get("String_Node_Str"));
}
Program: 37157
Project: 37157
Buggy source:
/** 
 * setServiceFilters.
 * @param serviceFilters serviceFilters.
 */
@Resource(name="String_Node_Str") public void setServiceFilters(List<QueryFilter> serviceFilters){
  RestResponse.queryFilters=serviceFilters;
}

Fixed version (ground truth):
/** 
 * setServiceFilters.
 * @param serviceFilters serviceFilters.
 */
@Resource(name="String_Node_Str") @Qualifier("String_Node_Str") public void setServiceFilters(List<QueryFilter> serviceFilters){
  RestResponse.queryFilters=serviceFilters;
}
Program: 37158
Project: 37158
Buggy source:
private void queryDomainStatus(Domain domain){
  final long domainId=domain.getId();
  List<String> result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(SQL_QUERY_DOMAIN_STATUS);
      ps.setLong(1,domainId);
      return ps;
    }
  }
,new StatusResultSetExtractor());
  if (null != result && result.size() != 0) {
    domain.setStatus(result);
  }
}

Fixed version (ground truth):
public void queryDomainStatus(Domain domain){
  if (domain != null) {
    final long domainId=domain.getId();
    List<String> result=jdbcTemplate.query(new PreparedStatementCreator(){
      @Override public PreparedStatement createPreparedStatement(      Connection connection) throws SQLException {
        PreparedStatement ps=connection.prepareStatement(SQL_QUERY_DOMAIN_STATUS);
        ps.setLong(1,domainId);
        return ps;
      }
    }
,new StatusResultSetExtractor());
    if (null != result && result.size() != 0) {
      domain.setStatus(result);
    }
  }
}
Program: 37159
Project: 37159
Buggy source:
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainSearchParam=(DomainSearchParam)queryParam;
  final String domainName=domainSearchParam.getQ();
  final String punyName=domainSearchParam.getPunyName();
  final String domainNameLikeClause=generateLikeClause(domainName);
  final String punyNameLikeClause=generateLikeClause(punyName);
  final String sql="String_Node_Str" + DomainQueryDaoImpl.SQL_LEFT_JOIN_DOMAIN_STATUS + "String_Node_Str"+ "String_Node_Str";
  final PageBean page=domainSearchParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  List<Domain> result=null;
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyNameLikeClause);
      ps.setString(2,domainNameLikeClause);
      ps.setLong(3,startRow);
      ps.setLong(4,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  return result;
}

Fixed version (ground truth):
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainSearchParam=(DomainSearchParam)queryParam;
  final String domainName=domainSearchParam.getQ();
  final String punyName=domainSearchParam.getPunyName();
  final String domainNameLikeClause=generateLikeClause(domainName);
  final String punyNameLikeClause=generateLikeClause(punyName);
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  final PageBean page=domainSearchParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  List<Domain> result=null;
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyNameLikeClause);
      ps.setString(2,domainNameLikeClause);
      ps.setLong(3,startRow);
      ps.setLong(4,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  for (  Domain domain : result) {
    domainDao.queryDomainStatus(domain);
  }
  return result;
}
Program: 37160
Project: 37160
Buggy source:
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainQueryParam=(DomainSearchParam)queryParam;
  List<Domain> result=null;
  final PageBean page=domainQueryParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  String ipPrefix=domainQueryParam.getQ();
  IpVersion ipVersion=IpUtil.getIpVersionOfIp(ipPrefix);
  final byte[] ipBytes=IpUtil.ipToByteArray(ipPrefix,ipVersion);
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + DomainQueryDaoImpl.SQL_LEFT_JOIN_DOMAIN_STATUS + "String_Node_Str";
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setBytes(1,ipBytes);
      ps.setLong(2,startRow);
      ps.setLong(3,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  return result;
}

Fixed version (ground truth):
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainQueryParam=(DomainSearchParam)queryParam;
  List<Domain> result=null;
  final PageBean page=domainQueryParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  String ipPrefix=domainQueryParam.getQ();
  IpVersion ipVersion=IpUtil.getIpVersionOfIp(ipPrefix);
  final byte[] ipBytes=IpUtil.ipToByteArray(ipPrefix,ipVersion);
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  result=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setBytes(1,ipBytes);
      ps.setLong(2,startRow);
      ps.setLong(3,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  for (  Domain domain : result) {
    domainDao.queryDomainStatus(domain);
  }
  return result;
}
Program: 37161
Project: 37161
Buggy source:
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainQueryParam=(DomainSearchParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  final String punyNameLikeClause=generateLikeClause(punyName);
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + DomainQueryDaoImpl.SQL_LEFT_JOIN_DOMAIN_STATUS + "String_Node_Str"+ "String_Node_Str";
  final PageBean page=queryParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyNameLikeClause);
      ps.setLong(2,startRow);
      ps.setLong(3,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  return result;
}

Fixed version (ground truth):
@Override public List<Domain> search(QueryParam queryParam,JdbcTemplate jdbcTemplate){
  DomainSearchParam domainQueryParam=(DomainSearchParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  final String punyNameLikeClause=generateLikeClause(punyName);
  final String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  final PageBean page=queryParam.getPageBean();
  int startPage=page.getCurrentPage() - 1;
  startPage=startPage >= 0 ? startPage : 0;
  final long startRow=startPage * page.getMaxRecords();
  DomainQueryDaoImpl domainDao=new DomainQueryDaoImpl();
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyNameLikeClause);
      ps.setLong(2,startRow);
      ps.setLong(3,page.getMaxRecords());
      return ps;
    }
  }
,domainDao.new DomainWithStatusResultSetExtractor());
  for (  Domain domain : result) {
    domainDao.queryDomainStatus(domain);
  }
  return result;
}
Program: 37162
Project: 37162
Buggy source:
/** 
 * batch create KeyData.
 * @param outerObjectId object id of outer object	 
 * @param models KeyData of outer Object
 */
@Override public void batchCreateAsInnerObjects(BaseModel outerModel,List<KeyDataDto> models){
  if (null == models || models.size() == 0) {
    return;
  }
  for (  KeyDataDto model : models) {
    Long keyDataId=createKeyData(model);
    secureDnsUpdateDao.createRelSecureDnsDskey(outerModel.getId(),ModelType.KEYDATA,keyDataId);
    KeyData keyDataAsOuter=new KeyData();
    keyDataAsOuter.setId(keyDataId);
    linkUpdateDao.batchCreateAsInnerObjects(keyDataAsOuter,model.getLinks());
    eventUpdateDao.batchCreateAsInnerObjects(keyDataAsOuter,model.getEvents());
  }
}

Fixed version (ground truth):
/** 
 * batch create KeyData.
 * @param outerModel outer object	 
 * @param models KeyData of outer Object
 */
@Override public void batchCreateAsInnerObjects(BaseModel outerModel,List<KeyDataDto> models){
  if (null == models || models.size() == 0) {
    return;
  }
  for (  KeyDataDto model : models) {
    Long keyDataId=createKeyData(model);
    secureDnsUpdateDao.createRelSecureDnsDskey(outerModel.getId(),ModelType.KEYDATA,keyDataId);
    KeyData keyDataAsOuter=new KeyData();
    keyDataAsOuter.setId(keyDataId);
    linkUpdateDao.batchCreateAsInnerObjects(keyDataAsOuter,model.getLinks());
    eventUpdateDao.batchCreateAsInnerObjects(keyDataAsOuter,model.getEvents());
  }
}
Program: 37163
Project: 37163
Buggy source:
/** 
 * batch create publicId.
 * @param outerObjectId object id of outer object
 * @param outerModelType model type of outer object
 * @param models PublicId of outer Object
 */
@Override public void batchCreateAsInnerObjects(BaseModel outerModel,List<PublicIdDto> models){
  if (null == models || models.size() == 0) {
    return;
  }
  for (  PublicIdDto model : models) {
    Long publicId=queryByIndentifierAndType(model);
    if (null == publicId) {
      publicId=createPublicId(model);
    }
    createRelPublicId(outerModel,publicId);
  }
}

Fixed version (ground truth):
/** 
 * batch create publicId.
 * @param outerModel outer object
 * @param models PublicId of outer Object
 */
@Override public void batchCreateAsInnerObjects(BaseModel outerModel,List<PublicIdDto> models){
  if (null == models || models.size() == 0) {
    return;
  }
  for (  PublicIdDto model : models) {
    Long publicId=queryByIndentifierAndType(model);
    if (null == publicId) {
      publicId=createPublicId(model);
    }
    createRelPublicId(outerModel,publicId);
  }
}
Program: 37164
Project: 37164
Buggy source:
/** 
 * @param outerObjectId object id of outer object
 * @param outerModelType model type of outer object
 * @param publicId publicId
 */
private void createRelPublicId(final BaseModel outerModel,final Long publicId){
  final String sql="String_Node_Str" + "String_Node_Str";
  jdbcTemplate.update(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setLong(1,outerModel.getId());
      ps.setString(2,outerModel.getObjectType().getName());
      ps.setLong(3,publicId);
      return ps;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param outerModel outer object
 * @param publicId publicId
 */
private void createRelPublicId(final BaseModel outerModel,final Long publicId){
  final String sql="String_Node_Str" + "String_Node_Str";
  jdbcTemplate.update(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setLong(1,outerModel.getId());
      ps.setString(2,outerModel.getObjectType().getName());
      ps.setLong(3,publicId);
      return ps;
    }
  }
);
}
Program: 37165
Project: 37165
Buggy source:
/** 
 * query publicId from RDAP_PUBLICID by IDENTIFIER and TYPE.
 * @param model PublicId object.
 * @return public id
 */
private Long queryByIndentifierAndType(final PublicIdDto model){
  final String sql="String_Node_Str" + "String_Node_Str";
  List<Long> PublicIds=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,model.getIdentifier());
      ps.setString(2,model.getType());
      return ps;
    }
  }
,new RowMapper<Long>(){
    public Long mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return rs.getLong("String_Node_Str");
    }
  }
);
  if (PublicIds.size() > 0) {
    return PublicIds.get(0);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * query publicId from RDAP_PUBLICID by IDENTIFIER and TYPE.
 * @param model PublicId object.
 * @return public id
 */
private Long queryByIndentifierAndType(final PublicIdDto model){
  final String sql="String_Node_Str" + "String_Node_Str";
  List<Long> publicIds=jdbcTemplate.query(new PreparedStatementCreator(){
    public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,model.getIdentifier());
      ps.setString(2,model.getType());
      return ps;
    }
  }
,new RowMapper<Long>(){
    public Long mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return rs.getLong("String_Node_Str");
    }
  }
);
  if (publicIds.size() > 0) {
    return publicIds.get(0);
  }
  return null;
}
Program: 37166
Project: 37166
Buggy source:
/** 
 * query common domain and its status from database, without inner objects.
 * @param queryParam query parameter include punyname.
 * @return domain object without inner objects.
 */
private Domain queryDomainWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  LOGGER.debug("String_Node_Str",punyName);
  final String sql="String_Node_Str" + SQL_LEFT_JOIN_DOMAIN_STATUS + "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}

Fixed version (ground truth):
/** 
 * query common domain and its status from database, without inner objects.
 * @param queryParam query parameter include punyname.
 * @return domain object without inner objects.
 */
private Domain queryDomainWithoutInnerObjects(QueryParam queryParam){
  DomainQueryParam domainQueryParam=(DomainQueryParam)queryParam;
  final String punyName=domainQueryParam.getPunyName();
  LOGGER.debug("String_Node_Str",punyName);
  final String sql="String_Node_Str" + "String_Node_Str";
  List<Domain> result=jdbcTemplate.query(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql);
      ps.setString(1,punyName);
      return ps;
    }
  }
,new DomainWithStatusResultSetExtractor());
  if (null == result || result.size() == 0) {
    return null;
  }
  return result.get(0);
}
Program: 37167
Project: 37167
Buggy source:
@Override public List<Domain> extractData(ResultSet rs) throws SQLException {
  List<Domain> result=new ArrayList<Domain>();
  Map<Long,Domain> domainMapById=new HashMap<Long,Domain>();
  while (rs.next()) {
    Long domainId=rs.getLong("String_Node_Str");
    Domain domain=domainMapById.get(domainId);
    if (null == domain) {
      domain=new Domain();
      extractDomainFromRs(rs,domain);
      extractCustomPropertiesFromRs(rs,domain);
      result.add(domain);
      domainMapById.put(domainId,domain);
    }
    domain.addStatus(rs.getString("String_Node_Str"));
  }
  return result;
}

Fixed version (ground truth):
@Override public List<String> extractData(ResultSet rs) throws SQLException {
  List<String> result=new ArrayList<String>();
  while (rs.next()) {
    String status=rs.getString("String_Node_Str");
    if (!result.contains(status)) {
      result.add(status);
    }
  }
  return result;
}