nus-yam/ex-repair huggingface dataset:
Program: 161071
Project: 161071
Buggy source:
@Test public void listVersions_created_updated(){
  final RpslObjectUpdateInfo add=updateDao.createObject(RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
  testDateTimeProvider.setTime(new LocalDateTime().plusDays(3));
  updateDao.updateObject(add.getObjectId(),RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"));
  final WhoisResources result=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON_TYPE).get(WhoisResources.class);
  assertThat(result.getErrorMessages(),hasSize(0));
  final List<WhoisVersionInternal> versions=result.getVersionsInternal().getVersions();
  assertThat(versions,hasSize(2));
  final String fromFirst=versions.get(0).getFrom();
  final String toFirst=versions.get(0).getTo();
  final String fromLast=versions.get(1).getFrom();
  final String toLast=versions.get(1).getTo();
  final LocalDateTime fromDate=parse(fromFirst,DEFAULT_DATE_TIME_FORMATTER);
  final LocalDateTime toDate=parse(toFirst,DEFAULT_DATE_TIME_FORMATTER);
  final LocalDateTime fromLastDate=parse(fromLast,DEFAULT_DATE_TIME_FORMATTER);
  assertThat(Period.fieldDifference(fromDate,toDate).getDays(),is(3));
  assertThat(toDate,is(fromLastDate));
  assertThat(toLast,is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void listVersions_created_updated(){
  final RpslObjectUpdateInfo add=updateDao.createObject(RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
  testDateTimeProvider.setTime(new LocalDateTime().plusDays(3));
  updateDao.updateObject(add.getObjectId(),RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"));
  final WhoisResources result=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON_TYPE).get(WhoisResources.class);
  assertThat(result.getErrorMessages(),hasSize(0));
  final List<WhoisVersionInternal> versions=result.getVersionsInternal().getVersions();
  assertThat(versions,hasSize(2));
  final String fromFirst=versions.get(0).getFrom();
  final String toFirst=versions.get(0).getTo();
  final String fromLast=versions.get(1).getFrom();
  final String toLast=versions.get(1).getTo();
  final LocalDateTime fromDate=parse(fromFirst,DEFAULT_DATE_TIME_FORMATTER);
  final LocalDateTime toDate=parse(toFirst,DEFAULT_DATE_TIME_FORMATTER);
  final LocalDateTime fromLastDate=parse(fromLast,DEFAULT_DATE_TIME_FORMATTER);
  assertThat(new Period(fromDate,toDate).getDays(),is(3));
  assertThat(toDate,is(fromLastDate));
  assertThat(toLast,is("String_Node_Str"));
}
Program: 161072
Project: 161072
Buggy source:
private WhoisResources createResponse(final HttpServletRequest request,final UpdateContext updateContext,final Update update){
  final WhoisResources whoisResources=new WhoisResources();
  final List<ErrorMessage> errorMessages=Lists.newArrayList();
  for (  Message message : updateContext.getGlobalMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Message message : updateContext.getMessages(update).getMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Map.Entry<RpslAttribute,Messages> entry : updateContext.getMessages(update).getAttributeMessages().entrySet()) {
    RpslAttribute rpslAttribute=entry.getKey();
    for (    Message message : entry.getValue().getAllMessages()) {
      errorMessages.add(new ErrorMessage(message,rpslAttribute));
    }
  }
  if (!errorMessages.isEmpty()) {
    whoisResources.setErrorMessages(errorMessages);
  }
  final PreparedUpdate preparedUpdate=updateContext.getPreparedUpdate(update);
  if (preparedUpdate != null) {
    whoisResources.setWhoisObjects(Collections.singletonList(whoisObjectMapper.map(preparedUpdate.getUpdatedObject(),RestServiceHelper.getServerAttributeMapper(request))));
  }
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request).replaceFirst("String_Node_Str","String_Node_Str")));
  whoisResources.includeTermsAndConditions();
  return whoisResources;
}

Fixed version (ground truth):
private WhoisResources createResponse(final HttpServletRequest request,final UpdateContext updateContext,final Update update){
  final WhoisResources whoisResources=new WhoisResources();
  final List<ErrorMessage> errorMessages=Lists.newArrayList();
  for (  Message message : updateContext.getGlobalMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Message message : updateContext.getMessages(update).getMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Map.Entry<RpslAttribute,Messages> entry : updateContext.getMessages(update).getAttributeMessages().entrySet()) {
    RpslAttribute rpslAttribute=entry.getKey();
    for (    Message message : entry.getValue().getAllMessages()) {
      errorMessages.add(new ErrorMessage(message,rpslAttribute));
    }
  }
  if (!errorMessages.isEmpty()) {
    whoisResources.setErrorMessages(errorMessages);
  }
  final PreparedUpdate preparedUpdate=updateContext.getPreparedUpdate(update);
  if (preparedUpdate != null) {
    final WhoisObject whoisObject=whoisObjectMapper.map(preparedUpdate.getUpdatedObject(),RestServiceHelper.getServerAttributeMapper(request.getQueryString()));
    whoisResources.setWhoisObjects(Collections.singletonList(whoisObject));
  }
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request).replaceFirst("String_Node_Str","String_Node_Str")));
  whoisResources.includeTermsAndConditions();
  return whoisResources;
}
Program: 161073
Project: 161073
Buggy source:
public static Class<? extends AttributeMapper> getServerAttributeMapper(HttpServletRequest request){
  return isQueryParamSet(request.getQueryString(),"String_Node_Str") ? DirtyServerAttributeMapper.class : FormattedServerAttributeMapper.class;
}

Fixed version (ground truth):
public static Class<? extends AttributeMapper> getServerAttributeMapper(String queryString){
  return isQueryParamSet(queryString,"String_Node_Str") ? DirtyServerAttributeMapper.class : FormattedServerAttributeMapper.class;
}
Program: 161074
Project: 161074
Buggy source:
public static boolean isQueryParamSet(final String queryString,final String key){
  if (queryString == null) {
    return false;
  }
  for (  String next : AMPERSAND_SPLITTER.split(queryString)) {
    final Iterator<String> iterator=EQUALS_SPLITTER.split(next).iterator();
    if (iterator.hasNext()) {
      if (iterator.next().equals(key) && (!iterator.hasNext() || iterator.next().equals("String_Node_Str"))) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isQueryParamSet(final String queryString,final String key){
  if (queryString == null) {
    return false;
  }
  for (  String next : AMPERSAND_SPLITTER.split(queryString)) {
    final Iterator<String> iterator=EQUALS_SPLITTER.split(next).iterator();
    if (iterator.hasNext()) {
      if (iterator.next().equals(key)) {
        if (!iterator.hasNext())         return true;
        String value=iterator.next();
        if (StringUtils.isEmpty(value) || value.equalsIgnoreCase("String_Node_Str"))         return true;
      }
    }
  }
  return false;
}
Program: 161076
Project: 161076
Buggy source:
private Response handleQueryAndStreamResponse(final Query query,final HttpServletRequest request,final InetAddress remoteAddress,@Nullable final Parameters parameters,@Nullable final Service service,final Class<? extends AttributeMapper> attributeMapper){
  return Response.ok(new RpslObjectStreamer(request,query,remoteAddress,parameters,service,attributeMapper)).build();
}

Fixed version (ground truth):
private Response handleQueryAndStreamResponse(final Query query,final HttpServletRequest request,final InetAddress remoteAddress,@Nullable final Parameters parameters,@Nullable final Service service){
  return Response.ok(new RpslObjectStreamer(request,query,remoteAddress,parameters,service)).build();
}
Program: 161077
Project: 161077
Buggy source:
@GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("String_Node_Str") public Response lookup(@Context final HttpServletRequest request,@PathParam("String_Node_Str") final String source,@PathParam("String_Node_Str") final String objectType,@PathParam("String_Node_Str") final String key,@QueryParam("String_Node_Str") final List<String> passwords,@CookieParam("String_Node_Str") final String crowdTokenKey){
  if (!sourceContext.getAllSourceNames().contains(ciString(source))) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.invalidSource(source))).build());
  }
  QueryBuilder queryBuilder=new QueryBuilder().addFlag(QueryFlag.EXACT).addFlag(QueryFlag.NO_GROUPING).addFlag(QueryFlag.NO_REFERENCED).addFlag(QueryFlag.SHOW_TAG_INFO).addCommaList(QueryFlag.SOURCES,source).addCommaList(QueryFlag.SELECT_TYPES,ObjectType.getByName(objectType).getName());
  if (isQueryParamSet(request.getQueryString(),"String_Node_Str")) {
    queryBuilder.addFlag(QueryFlag.NO_FILTERING);
  }
  try {
    final Query query=Query.parse(queryBuilder.build(key),crowdTokenKey,passwords).setMatchPrimaryKeyOnly(true);
    return handleQueryAndStreamResponse(query,request,InetAddresses.forString(request.getRemoteAddr()),null,null,getServerAttributeMapper(request));
  }
 catch (  QueryException e) {
    throw getWebApplicationException(e,request,Lists.<Message>newArrayList());
  }
}

Fixed version (ground truth):
@GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("String_Node_Str") public Response lookup(@Context final HttpServletRequest request,@PathParam("String_Node_Str") final String source,@PathParam("String_Node_Str") final String objectType,@PathParam("String_Node_Str") final String key,@QueryParam("String_Node_Str") final List<String> passwords,@CookieParam("String_Node_Str") final String crowdTokenKey){
  if (!sourceContext.getAllSourceNames().contains(ciString(source))) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.invalidSource(source))).build());
  }
  QueryBuilder queryBuilder=new QueryBuilder().addFlag(QueryFlag.EXACT).addFlag(QueryFlag.NO_GROUPING).addFlag(QueryFlag.NO_REFERENCED).addFlag(QueryFlag.SHOW_TAG_INFO).addCommaList(QueryFlag.SOURCES,source).addCommaList(QueryFlag.SELECT_TYPES,ObjectType.getByName(objectType).getName());
  if (isQueryParamSet(request.getQueryString(),"String_Node_Str")) {
    queryBuilder.addFlag(QueryFlag.NO_FILTERING);
  }
  try {
    final Query query=Query.parse(queryBuilder.build(key),crowdTokenKey,passwords).setMatchPrimaryKeyOnly(true);
    return handleQueryAndStreamResponse(query,request,InetAddresses.forString(request.getRemoteAddr()),null,null);
  }
 catch (  QueryException e) {
    throw getWebApplicationException(e,request,Lists.<Message>newArrayList());
  }
}
Program: 161078
Project: 161078
Buggy source:
public RpslObjectStreamer(final HttpServletRequest request,final Query query,final InetAddress remoteAddress,final Parameters parameters,final Service service,final Class<? extends AttributeMapper> attributeMapper){
  this.request=request;
  this.query=query;
  this.remoteAddress=remoteAddress;
  this.parameters=parameters;
  this.service=service;
  this.attributeMapper=attributeMapper;
}

Fixed version (ground truth):
public RpslObjectStreamer(final HttpServletRequest request,final Query query,final InetAddress remoteAddress,final Parameters parameters,final Service service){
  this.request=request;
  this.query=query;
  this.remoteAddress=remoteAddress;
  this.parameters=parameters;
  this.service=service;
  this.attributeMapper=RestServiceHelper.getServerAttributeMapper(request.getQueryString());
}
Program: 161079
Project: 161079
Buggy source:
private RpslObject getSubmittedObject(final HttpServletRequest request,final WhoisResources whoisResources){
  if (whoisResources.getWhoisObjects().isEmpty() || whoisResources.getWhoisObjects().size() > 1) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.singleObjectExpected(whoisResources.getWhoisObjects().size()))).build());
  }
  return whoisObjectMapper.map(whoisResources.getWhoisObjects().get(0),getServerAttributeMapper(request));
}

Fixed version (ground truth):
private RpslObject getSubmittedObject(final HttpServletRequest request,final WhoisResources whoisResources){
  if (whoisResources.getWhoisObjects().isEmpty() || whoisResources.getWhoisObjects().size() > 1) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.singleObjectExpected(whoisResources.getWhoisObjects().size()))).build());
  }
  return whoisObjectMapper.map(whoisResources.getWhoisObjects().get(0),getServerAttributeMapper(request.getQueryString()));
}
Program: 161080
Project: 161080
Buggy source:
@Override public Collection<Attribute> map(RpslAttribute rpslAttribute,String source){
  final Set<CIString> cleanValues=rpslAttribute.getCleanValues();
  if (cleanValues.size() == 1) {
    final CIString cleanValue=cleanValues.iterator().next();
    final String referencedType=(rpslAttribute.getType() != null) ? referencedTypeResolver.getReferencedType(rpslAttribute.getType(),cleanValue) : null;
    final Link link=(referencedType != null) ? createLink(source,referencedType,cleanValue.toString()) : null;
    return Collections.singleton(new Attribute(rpslAttribute.getKey(),rpslAttribute.getValue(),null,referencedType,link));
  }
 else {
    return Collections.singleton(new Attribute(rpslAttribute.getKey(),rpslAttribute.getValue(),null,null,null));
  }
}

Fixed version (ground truth):
@Override public Collection<Attribute> map(RpslAttribute rpslAttribute,String source){
  final Set<CIString> cleanValues=rpslAttribute.getCleanValues();
  if (cleanValues.size() == 1) {
    final CIString cleanValue=cleanValues.iterator().next();
    final String referencedType=(rpslAttribute.getType() != null) ? referencedTypeResolver.getReferencedType(rpslAttribute.getType(),cleanValue) : null;
    final Link link=(referencedType != null) ? createLink(source,referencedType,cleanValue.toString()) : null;
    return Collections.singleton(new Attribute(rpslAttribute.getKey(),rpslAttribute.getFormattedValue(),null,referencedType,link));
  }
 else {
    return Collections.singleton(new Attribute(rpslAttribute.getKey(),rpslAttribute.getFormattedValue(),null,null,null));
  }
}
Program: 161081
Project: 161081
Buggy source:
@Test @Ignore("String_Node_Str") public void lookup_inet6num_without_prefix_length() throws InterruptedException {
  databaseHelper.addObject("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");
  databaseHelper.addObject("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");
  ipTreeUpdater.rebuild();
  Thread.sleep(Long.MAX_VALUE);
  RestTest.target(getPort(),"String_Node_Str").request().get(WhoisResources.class);
}

Fixed version (ground truth):
@Test(expected=NotFoundException.class) public void lookup_inet6num_without_prefix_length() throws InterruptedException {
  databaseHelper.addObject("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");
  ipTreeUpdater.rebuild();
  RestTest.target(getPort(),"String_Node_Str").request().get(WhoisResources.class);
}
Program: 161082
Project: 161082
Buggy source:
@Override public Boolean call() throws Exception {
  for (  MimeMessage message : messages) {
    if (message.getRecipients(Message.RecipientType.TO)[0].toString().equalsIgnoreCase(to)) {
      this.message=message;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
synchronized (messages) {
    for (    MimeMessage message : messages) {
      if (message.getRecipients(Message.RecipientType.TO)[0].toString().equalsIgnoreCase(to)) {
        this.message=message;
        return true;
      }
    }
  }
  return false;
}
Program: 161083
Project: 161083
Buggy source:
@GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("String_Node_Str") public Response lookup(@Context final HttpServletRequest request,@PathParam("String_Node_Str") final String source,@PathParam("String_Node_Str") final String objectType,@PathParam("String_Node_Str") final String key,@QueryParam("String_Node_Str") final List<String> passwords,@CookieParam("String_Node_Str") final String crowdTokenKey){
  if (!sourceContext.getAllSourceNames().contains(ciString(source))) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.invalidSource(source))).build());
  }
  QueryBuilder queryBuilder=new QueryBuilder().addFlag(QueryFlag.EXACT).addFlag(QueryFlag.NO_GROUPING).addFlag(QueryFlag.NO_REFERENCED).addFlag(QueryFlag.SHOW_TAG_INFO).addCommaList(QueryFlag.SOURCES,source).addCommaList(QueryFlag.SELECT_TYPES,ObjectType.getByName(objectType).getName());
  if (isQueryParamSet(request.getQueryString(),"String_Node_Str")) {
    queryBuilder.addFlag(QueryFlag.NO_FILTERING);
  }
  final Query query=Query.parse(queryBuilder.build(key),crowdTokenKey,passwords);
  return handleQueryAndStreamResponse(query,request,InetAddresses.forString(request.getRemoteAddr()),null,null);
}

Fixed version (ground truth):
@GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("String_Node_Str") public Response lookup(@Context final HttpServletRequest request,@PathParam("String_Node_Str") final String source,@PathParam("String_Node_Str") final String objectType,@PathParam("String_Node_Str") final String key,@QueryParam("String_Node_Str") final List<String> passwords,@CookieParam("String_Node_Str") final String crowdTokenKey){
  if (!sourceContext.getAllSourceNames().contains(ciString(source))) {
    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(createErrorEntity(request,RestMessages.invalidSource(source))).build());
  }
  QueryBuilder queryBuilder=new QueryBuilder().addFlag(QueryFlag.EXACT).addFlag(QueryFlag.NO_GROUPING).addFlag(QueryFlag.NO_REFERENCED).addFlag(QueryFlag.SHOW_TAG_INFO).addCommaList(QueryFlag.SOURCES,source).addCommaList(QueryFlag.SELECT_TYPES,ObjectType.getByName(objectType).getName());
  if (isQueryParamSet(request.getQueryString(),"String_Node_Str")) {
    queryBuilder.addFlag(QueryFlag.NO_FILTERING);
  }
  final Query query=Query.parse(queryBuilder.build(key),crowdTokenKey,passwords);
  query.setMatchPrimaryKeyOnly(true);
  return handleQueryAndStreamResponse(query,request,InetAddresses.forString(request.getRemoteAddr()),null,null);
}
Program: 161084
Project: 161084
Buggy source:
@Override public boolean supports(final Query query){
  if ((!query.hasOptions() && query.isHelp()) || query.isSystemInfo() || query.isTemplate()|| query.isVerbose()|| query.isVersionList()|| query.isObjectVersion()|| query.isVersionDiff()) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean supports(final Query query){
  if ((!query.hasOptions() && query.isHelp()) || query.isSystemInfo() || query.isTemplate()|| query.isVerbose()|| query.isVersionList()|| query.isObjectVersion()|| query.isVersionDiff()|| query.isMatchPrimaryKeyOnly()) {
    return false;
  }
  return true;
}
Program: 161085
Project: 161085
Buggy source:
public void addValidationMessagesForAttributeTemplate(ObjectMessages objectMessages,AttributeTemplate attributeTemplate,Map<AttributeType,Integer> attributeCount){
  final AttributeType attributeType=attributeTemplate.getAttributeType();
  final int attributeTypeCount=attributeCount.get(attributeType);
  if (attributeTemplate.getRequirement() == MANDATORY && attributeTypeCount == 0) {
    objectMessages.addMessage(ValidationMessages.missingMandatoryAttribute(attributeType));
  }
  if (attributeTemplate.getCardinality() == SINGLE && attributeTypeCount > 1) {
    objectMessages.addMessage(ValidationMessages.tooManyAttributesOfType(attributeType));
  }
}

Fixed version (ground truth):
public void addValidationMessagesForAttributeTemplate(ObjectMessages objectMessages,AttributeTemplate attributeTemplate,Map<AttributeType,Integer> attributeCount){
  final AttributeType attributeType=attributeTemplate.getAttributeType();
  final int attributeTypeCount=attributeCount.get(attributeType);
  if (attributeTemplate.getRequirement() == MANDATORY && attributeTypeCount == 0) {
    objectMessages.addMessage(ValidationMessages.missingMandatoryAttribute(attributeType));
  }
  if ((attributeTemplate.getCardinality() == SINGLE || attributeTemplate.getRequirement() == GENERATED) && attributeTypeCount > 1) {
    objectMessages.addMessage(ValidationMessages.tooManyAttributesOfType(attributeType));
  }
}
Program: 161086
Project: 161086
Buggy source:
public ObjectMessages validate(final RpslObject rpslObject){
  final ObjectMessages objectMessages=new ObjectMessages();
  final ObjectType rpslObjectType=rpslObject.getType();
  final Map<AttributeType,Integer> attributeCount=Maps.newEnumMap(AttributeType.class);
  for (  final AttributeTemplate attributeTemplate : attributeTemplates) {
    attributeCount.put(attributeTemplate.getAttributeType(),0);
  }
  for (  final RpslAttribute attribute : rpslObject.getAttributes()) {
    final AttributeType attributeType=attribute.getType();
    if (attributeType == null) {
      objectMessages.addMessage(attribute,ValidationMessages.unknownAttribute(attribute.getKey()));
    }
 else {
      final AttributeTemplate attributeTemplate=attributeTemplateMap.get(attributeType);
      if (attributeTemplate == null) {
        objectMessages.addMessage(attribute,ValidationMessages.invalidAttributeForObject(attributeType));
      }
 else       if (!attributeTemplate.getRequirement().equals(GENERATED)) {
        attribute.validateSyntax(rpslObjectType,objectMessages);
        attributeCount.put(attributeType,attributeCount.get(attributeType) + 1);
      }
    }
  }
  for (  final AttributeTemplate attributeTemplate : attributeTemplates) {
    addValidationMessagesForAttributeTemplate(objectMessages,attributeTemplate,attributeCount);
  }
  return objectMessages;
}

Fixed version (ground truth):
public ObjectMessages validate(final RpslObject rpslObject){
  final ObjectMessages objectMessages=new ObjectMessages();
  final ObjectType rpslObjectType=rpslObject.getType();
  final Map<AttributeType,Integer> attributeCount=Maps.newEnumMap(AttributeType.class);
  for (  final AttributeTemplate attributeTemplate : attributeTemplates) {
    attributeCount.put(attributeTemplate.getAttributeType(),0);
  }
  for (  final RpslAttribute attribute : rpslObject.getAttributes()) {
    final AttributeType attributeType=attribute.getType();
    if (attributeType == null) {
      objectMessages.addMessage(attribute,ValidationMessages.unknownAttribute(attribute.getKey()));
    }
 else {
      final AttributeTemplate attributeTemplate=attributeTemplateMap.get(attributeType);
      if (attributeTemplate == null) {
        objectMessages.addMessage(attribute,ValidationMessages.invalidAttributeForObject(attributeType));
      }
 else {
        attribute.validateSyntax(rpslObjectType,objectMessages);
        attributeCount.put(attributeType,attributeCount.get(attributeType) + 1);
      }
    }
  }
  for (  final AttributeTemplate attributeTemplate : attributeTemplates) {
    addValidationMessagesForAttributeTemplate(objectMessages,attributeTemplate,attributeCount);
  }
  return objectMessages;
}
Program: 161087
Project: 161087
Buggy source:
@Override public void start(){
  if (!nrtmEnabled) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  serverChannel=bootstrapChannel(nrtmServerPipelineFactory,port,"String_Node_Str");
  serverChannelLegacy=bootstrapChannel(legacyNrtmServerPipelineFactory,legacyPort,"String_Node_Str");
  port=((InetSocketAddress)serverChannel.getLocalAddress()).getPort();
  legacyPort=((InetSocketAddress)serverChannelLegacy.getLocalAddress()).getPort();
}

Fixed version (ground truth):
@Override public void start(){
  if (!nrtmEnabled) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  serverChannel=bootstrapChannel(nrtmServerPipelineFactory,nrtmPort,"String_Node_Str");
  serverChannelLegacy=bootstrapChannel(legacyNrtmServerPipelineFactory,nrtmPortLegacy,"String_Node_Str");
  port=((InetSocketAddress)serverChannel.getLocalAddress()).getPort();
  legacyPort=((InetSocketAddress)serverChannelLegacy.getLocalAddress()).getPort();
}
Program: 161088
Project: 161088
Buggy source:
@Before public void before() throws Exception {
  databaseHelper.addObject(MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  nrtmServer.start();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  nrtmImporter.start();
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  databaseHelper.addObject(MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  nrtmServer.start();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  nrtmImporter.start();
}
Program: 161089
Project: 161089
Buggy source:
@Test public void network_error() throws Exception {
  final RpslObject person=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(person);
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
  nrtmImporter.stop(true);
  nrtmServer.stop(true);
  final RpslObject person2=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(person2);
  nrtmServer.start();
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  nrtmImporter.start();
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
}

Fixed version (ground truth):
@Test public void network_error() throws Exception {
  final RpslObject person=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(person);
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
  nrtmImporter.stop(true);
  nrtmServer.stop(true);
  final RpslObject person2=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(person2);
  nrtmServer.start();
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  nrtmImporter.start();
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
}
Program: 161090
Project: 161090
Buggy source:
@Before public void before() throws Exception {
  databaseHelper.addObject(MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  nrtmServer.start();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  nrtmImporter.start();
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  databaseHelper.addObject(MNTNER);
  databaseHelper.addObjectToSource("String_Node_Str",MNTNER);
  nrtmServer.start();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  nrtmImporter.start();
}
Program: 161091
Project: 161091
Buggy source:
@Test public void add_person_from_nrtm_gap_in_serials() throws Exception {
  final RpslObject person=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  nrtmImporter.stop(true);
  nrtmServer.stop(true);
  final RpslObject rpslObject=databaseHelper.addObject("String_Node_Str");
  databaseHelper.getWhoisTemplate().update("String_Node_Str",rpslObject.getObjectId());
  databaseHelper.addObject(person);
  nrtmServer.start();
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.port));
  nrtmImporter.start();
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
}

Fixed version (ground truth):
@Test public void add_person_from_nrtm_gap_in_serials() throws Exception {
  final RpslObject person=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  nrtmImporter.stop(true);
  nrtmServer.stop(true);
  final RpslObject rpslObject=databaseHelper.addObject("String_Node_Str");
  databaseHelper.getWhoisTemplate().update("String_Node_Str",rpslObject.getObjectId());
  databaseHelper.addObject(person);
  nrtmServer.start();
  System.setProperty("String_Node_Str",Integer.toString(NrtmServer.getPort()));
  nrtmImporter.start();
  objectExists(ObjectType.PERSON,"String_Node_Str",true);
}
Program: 161092
Project: 161092
Buggy source:
@Override public void run(){
  PrintWriter out=null;
  BufferedReader in=null;
  Socket socket=null;
  try {
    socket=new Socket("String_Node_Str",NrtmServer.port);
    socket.setSoTimeout(1000);
    out=new PrintWriter(socket.getOutputStream(),true);
    in=new BufferedReader(new InputStreamReader(socket.getInputStream(),ChannelUtil.BYTE_ENCODING));
    out.println(query);
    for (; ; ) {
      try {
        String line=in.readLine();
        if (line == null) {
          error="String_Node_Str";
          return;
        }
        if (line.startsWith("String_Node_Str")) {
          error=line;
          return;
        }
        if (line.startsWith("String_Node_Str")) {
          addCount++;
          signalLatch(line.substring(4));
        }
        if (line.startsWith("String_Node_Str")) {
          delCount++;
          signalLatch(line.substring(4));
        }
      }
 catch (      SocketTimeoutException ignored) {
      }
      if (stop) {
        return;
      }
    }
  }
 catch (  Exception e) {
    error=e.getMessage();
  }
 finally {
    IOUtils.closeQuietly(out);
    IOUtils.closeQuietly(in);
    if (socket != null) {
      try {
        socket.close();
      }
 catch (      IOException ignored) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  PrintWriter out=null;
  BufferedReader in=null;
  Socket socket=null;
  try {
    socket=new Socket("String_Node_Str",NrtmServer.getPort());
    socket.setSoTimeout(1000);
    out=new PrintWriter(socket.getOutputStream(),true);
    in=new BufferedReader(new InputStreamReader(socket.getInputStream(),ChannelUtil.BYTE_ENCODING));
    out.println(query);
    for (; ; ) {
      try {
        String line=in.readLine();
        if (line == null) {
          error="String_Node_Str";
          return;
        }
        if (line.startsWith("String_Node_Str")) {
          error=line;
          return;
        }
        if (line.startsWith("String_Node_Str")) {
          addCount++;
          signalLatch(line.substring(4));
        }
        if (line.startsWith("String_Node_Str")) {
          delCount++;
          signalLatch(line.substring(4));
        }
      }
 catch (      SocketTimeoutException ignored) {
      }
      if (stop) {
        return;
      }
    }
  }
 catch (  Exception e) {
    error=e.getMessage();
  }
 finally {
    IOUtils.closeQuietly(out);
    IOUtils.closeQuietly(in);
    if (socket != null) {
      try {
        socket.close();
      }
 catch (      IOException ignored) {
      }
    }
  }
}
Program: 161093
Project: 161093
Buggy source:
@Test public void dontHangOnHugeAutNumObject() throws Exception {
  String response=DummyWhoisClient.query(NrtmServer.port,String.format("String_Node_Str",MIN_RANGE,MAX_RANGE),5 * 1000);
  assertTrue(response,response.contains(String.format("String_Node_Str",MIN_RANGE)));
  assertTrue(response,response.contains(String.format("String_Node_Str",MIN_RANGE + 1)));
}

Fixed version (ground truth):
@Test public void dontHangOnHugeAutNumObject() throws Exception {
  String response=DummyWhoisClient.query(NrtmServer.getPort(),String.format("String_Node_Str",MIN_RANGE,MAX_RANGE),5 * 1000);
  assertTrue(response,response.contains(String.format("String_Node_Str",MIN_RANGE)));
  assertTrue(response,response.contains(String.format("String_Node_Str",MIN_RANGE + 1)));
}
Program: 161094
Project: 161094
Buggy source:
@Test public void queryKeepAliveOnePreExistingObjectsOneNewObject() throws Exception {
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  AsyncNrtmClient client=new AsyncNrtmClient(NrtmServer.port,"String_Node_Str",(updateInterval + 1));
  client.start();
  super.databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  String response=client.end();
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void queryKeepAliveOnePreExistingObjectsOneNewObject() throws Exception {
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  AsyncNrtmClient client=new AsyncNrtmClient(NrtmServer.getPort(),"String_Node_Str",(updateInterval + 1));
  client.start();
  super.databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  String response=client.end();
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161095
Project: 161095
Buggy source:
@Test public void emptyQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void emptyQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161096
Project: 161096
Buggy source:
@Test public void sourcesQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void sourcesQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161097
Project: 161097
Buggy source:
@Test public void queryKeepAliveNoPreExistingObjectsOneNewObject() throws Exception {
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  AsyncNrtmClient client=new AsyncNrtmClient(NrtmServer.port,"String_Node_Str",(updateInterval + 1));
  client.start();
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  String response=client.end();
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void queryKeepAliveNoPreExistingObjectsOneNewObject() throws Exception {
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  AsyncNrtmClient client=new AsyncNrtmClient(NrtmServer.getPort(),"String_Node_Str",(updateInterval + 1));
  client.start();
  databaseHelper.addObject(RpslObject.parse("String_Node_Str"));
  String response=client.end();
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161098
Project: 161098
Buggy source:
@Test public void mirrorQueryMultipleSerialEntry() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mirrorQueryMultipleSerialEntry() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161099
Project: 161099
Buggy source:
@Test public void mirrorQueryOutofRange() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mirrorQueryOutofRange() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161100
Project: 161100
Buggy source:
@Test public void versionQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void versionQuery() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161101
Project: 161101
Buggy source:
@Test public void mirrorQueryOneSerialEntry() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mirrorQueryOneSerialEntry() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161102
Project: 161102
Buggy source:
@Test public void queryKeepaliveNoPreExistingObjects() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str",(updateInterval + 1) * 1000);
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void queryKeepaliveNoPreExistingObjects() throws Exception {
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str",(updateInterval + 1) * 1000);
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161103
Project: 161103
Buggy source:
@Test public void mirrorQueryWithLastKeyword() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mirrorQueryWithLastKeyword() throws Exception {
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  databaseHelper.addObject("String_Node_Str");
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,containsString("String_Node_Str"));
  assertThat(response,containsString("String_Node_Str"));
}
Program: 161104
Project: 161104
Buggy source:
@Test public void mirrorQueryLegacyStillAvailable() throws Exception {
  databaseHelper.addObject("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  final String legacyResponse=DummyWhoisClient.query(NrtmServer.legacyPort,"String_Node_Str");
  assertThat(legacyResponse,containsString("String_Node_Str"));
  final String response=DummyWhoisClient.query(NrtmServer.port,"String_Node_Str");
  assertThat(response,not(containsString("String_Node_Str")));
  assertThat(response,containsString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mirrorQueryLegacyStillAvailable() throws Exception {
  databaseHelper.addObject("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  final String legacyResponse=DummyWhoisClient.query(NrtmServer.getLegacyPort(),"String_Node_Str");
  assertThat(legacyResponse,containsString("String_Node_Str"));
  final String response=DummyWhoisClient.query(NrtmServer.getPort(),"String_Node_Str");
  assertThat(response,not(containsString("String_Node_Str")));
  assertThat(response,containsString("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"));
}
Program: 161105
Project: 161105
Buggy source:
@Test public void lookup_mntner_xml_text(){
  final String result=RestTest.target(getPort(),"String_Node_Str").request().get(String.class);
  assertThat(result,is("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"+ "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"));
}

Fixed version (ground truth):
@Test public void lookup_mntner_xml_text() throws Exception {
  final RpslObject TRICKY_MNT=RpslObject.parse("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");
  databaseHelper.addObject(TRICKY_MNT);
  final String response=RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML_TYPE).get(String.class);
  assertThat(response,is("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"+ "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"));
}
Program: 161107
Project: 161107
Buggy source:
@Autowired public MailMessageDaoJdbc(@Qualifier("String_Node_Str") final DataSource dataSource,final DateTimeProvider dateTimeProvider){
  this.dateTimeProvider=dateTimeProvider;
  this.jdbcTemplate=new JdbcTemplate(dataSource);
  this.host=Hosts.getLocalHost();
}

Fixed version (ground truth):
@Autowired public MailMessageDaoJdbc(@Qualifier("String_Node_Str") final DataSource dataSource,final DateTimeProvider dateTimeProvider){
  this.dateTimeProvider=dateTimeProvider;
  this.jdbcTemplate=new JdbcTemplate(dataSource);
}
Program: 161108
Project: 161108
Buggy source:
@Override @CheckForNull public String claimMessage(){
  final String uuid=UUID.randomUUID().toString();
  final int rows=jdbcTemplate.update("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",DequeueStatus.CLAIMED.name(),dateTimeProvider.getCurrentDateTime().toDate().getTime() / 1000,host.name(),uuid);
switch (rows) {
case 0:
    return null;
case 1:
  return uuid;
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override @CheckForNull public String claimMessage(){
  final String uuid=UUID.randomUUID().toString();
  final int rows=jdbcTemplate.update("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",DequeueStatus.CLAIMED.name(),dateTimeProvider.getCurrentDateTime().toDate().getTime() / 1000,Hosts.getLocalHostName(),uuid);
switch (rows) {
case 0:
    return null;
case 1:
  return uuid;
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 161109
Project: 161109
Buggy source:
public long getDailyTaskFinishTime(final LocalDate date,final Class taskClass){
  final List<Long> result=jdbcTemplate.queryForList("String_Node_Str",Long.class,date.toString(),taskClass.getSimpleName());
  return result.isEmpty() ? -1 : result.get(0) * 1000;
}

Fixed version (ground truth):
public long getDailyTaskFinishTime(final LocalDate date,final Class taskClass){
  final List<Long> result=jdbcTemplate.queryForList("String_Node_Str",Long.class,date.toString(),taskClass.getSimpleName());
  return result.isEmpty() || result.get(0) == null ? -1 : result.get(0) * 1000;
}