nus-yam/ex-repair huggingface dataset:
Program: 160964
Project: 160964
Buggy source:
@Test public void testZmqDealer() throws Exception {
  final ZMQ.Context context=ZMQ.context(1);
  final ZMQ.Socket socket=context.socket(ZMQ.DEALER);
  socket.connect("String_Node_Str" + serverAddress.getHostString() + "String_Node_Str"+ serverAddress.getPort());
  final ZMsg request=ZMsg.newStringMsg("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  request.send(socket);
  final ZMTPIncomingMessage receivedRequest=incomingMessages.take();
  final ZMTPMessage receivedMessage=receivedRequest.getMessage();
  receivedRequest.getSession().getChannel().write(receivedMessage);
  final ZMsg reply=ZMsg.recvMsg(socket);
  assertEquals(request,reply);
  assertEquals(1,receivedMessage.getEnvelope().size());
  assertEquals(2,receivedMessage.getContent().size());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getEnvelope().get(0).getData());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getContent().get(0).getData());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getContent().get(1).getData());
}

Fixed version (ground truth):
@Test public void testZmqDealer() throws Exception {
  final ZMQ.Context context=ZMQ.context(1);
  final ZMQ.Socket socket=context.socket(ZMQ.DEALER);
  socket.connect("String_Node_Str" + serverAddress.getHostName() + "String_Node_Str"+ serverAddress.getPort());
  final ZMsg request=ZMsg.newStringMsg("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  request.send(socket);
  final ZMTPIncomingMessage receivedRequest=incomingMessages.take();
  final ZMTPMessage receivedMessage=receivedRequest.getMessage();
  receivedRequest.getSession().getChannel().write(receivedMessage);
  final ZMsg reply=ZMsg.recvMsg(socket);
  assertEquals(request,reply);
  assertEquals(1,receivedMessage.getEnvelope().size());
  assertEquals(2,receivedMessage.getContent().size());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getEnvelope().get(0).getData());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getContent().get(0).getData());
  assertArrayEquals("String_Node_Str".getBytes(),receivedMessage.getContent().get(1).getData());
}
Program: 160965
Project: 160965
Buggy source:
@Test public void testZmqRouter() throws Exception {
  final ZMQ.Context context=ZMQ.context(1);
  final ZMQ.Socket socket=context.socket(ZMQ.ROUTER);
  socket.connect("String_Node_Str" + serverAddress.getHostString() + "String_Node_Str"+ serverAddress.getPort());
  final ZMTPMessage request=new ZMTPMessage(asList(ZMTPFrame.create("String_Node_Str")),asList(ZMTPFrame.create("String_Node_Str"),ZMTPFrame.create("String_Node_Str")));
  final Channel channel=channelsConnected.take();
  channel.write(request);
  final ZMsg receivedReply=ZMsg.recvMsg(socket);
  assertEquals(ZMsg.newStringMsg(identity,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),receivedReply);
}

Fixed version (ground truth):
@Test public void testZmqRouter() throws Exception {
  final ZMQ.Context context=ZMQ.context(1);
  final ZMQ.Socket socket=context.socket(ZMQ.ROUTER);
  socket.connect("String_Node_Str" + serverAddress.getHostName() + "String_Node_Str"+ serverAddress.getPort());
  final ZMTPMessage request=new ZMTPMessage(asList(ZMTPFrame.create("String_Node_Str")),asList(ZMTPFrame.create("String_Node_Str"),ZMTPFrame.create("String_Node_Str")));
  final Channel channel=channelsConnected.take();
  channel.write(request);
  final ZMsg receivedReply=ZMsg.recvMsg(socket);
  assertEquals(ZMsg.newStringMsg(identity,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),receivedReply);
}
Program: 160966
Project: 160966
Buggy source:
public void start(){
  if (timerRunning) {
    return;
  }
  timerRunning=true;
  timer=new CountDownTimer(currentDuration,1000){
    @Override public void onTick(    long millis){
      currentDuration=millis;
      updateText(millis);
      invalidate();
    }
    @Override public void onFinish(){
      stop();
      if (listener != null) {
        listener.onFinishCountDown();
      }
    }
  }
;
  timer.start();
}

Fixed version (ground truth):
public void start(){
  if (timerRunning) {
    return;
  }
  timerRunning=true;
  timer=new CountDownTimer(currentDuration,100){
    @Override public void onTick(    long millis){
      currentDuration=millis;
      updateText(millis);
      invalidate();
    }
    @Override public void onFinish(){
      stop();
      if (listener != null) {
        listener.onFinishCountDown();
      }
    }
  }
;
  timer.start();
}
Program: 160967
Project: 160967
Buggy source:
@Test public void new_mode_nrtm_test(){
  given(NEW_MODE,OBJ_EXISTS_WITH_CHANGED).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
  given(NEW_MODE,OBJ_EXISTS_NO_CHANGED__).when(TELNET_,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
}

Fixed version (ground truth):
@Test public void new_mode_nrtm_test(){
  given(NEW_MODE,OBJ_EXISTS_WITH_CHANGED).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
  given(NEW_MODE,OBJ_EXISTS_NO_CHANGED__).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
}
Program: 160968
Project: 160968
Buggy source:
@Test public void old_mode_nrtm_test(){
  given(OLD_MODE,OBJ_EXISTS_WITH_CHANGED).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_WITH_CHANGED).run();
  given(OLD_MODE,OBJ_EXISTS_NO_CHANGED__).when(TELNET_,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
}

Fixed version (ground truth):
@Test public void old_mode_nrtm_test(){
  given(OLD_MODE,OBJ_EXISTS_WITH_CHANGED).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_WITH_CHANGED).run();
  given(OLD_MODE,OBJ_EXISTS_NO_CHANGED__).when(NRTM___,EVENT_,NOT_APPLIC__).then(SUCCESS,OBJ_EXISTS_NO_CHANGED__).run();
}
Program: 160970
Project: 160970
Buggy source:
private RpslObject replaceReferencesInMntner(final Collection<RpslObject> allObjects){
  for (  final RpslObject rpslObject : ImmutableSet.copyOf(allObjects)) {
    if (rpslObject.getType().equals(ObjectType.MNTNER)) {
      return replaceReferences(rpslObject,allObjects);
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
private RpslObjectWithReplacements replaceReferencesInMntner(final Collection<RpslObject> allObjects){
  for (  final RpslObject rpslObject : ImmutableSet.copyOf(allObjects)) {
    if (rpslObject.getType().equals(ObjectType.MNTNER)) {
      return replaceReferences(rpslObject,allObjects);
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 160971
Project: 160971
Buggy source:
private RpslObject replaceReferences(final RpslObject mntner,final Collection<RpslObject> references){
  final Map<RpslAttribute,RpslAttribute> replacements=Maps.newHashMap();
  for (  final RpslAttribute rpslAttribute : mntner.getAttributes()) {
    for (    final RpslObject reference : references) {
      if (rpslAttribute.getCleanValue().equals(reference.getKey()) && rpslAttribute.getType().getReferences().contains(ObjectType.PERSON) || rpslAttribute.getType().getReferences().contains(ObjectType.ROLE)) {
        replacements.put(rpslAttribute,new RpslAttribute(rpslAttribute.getType(),dummyRole));
      }
    }
  }
  if (replacements.isEmpty()) {
    return mntner;
  }
  final RpslObjectBuilder builder=new RpslObjectBuilder(mntner);
  for (  Map.Entry<RpslAttribute,RpslAttribute> entry : replacements.entrySet()) {
    builder.replaceAttribute(entry.getKey(),entry.getValue());
  }
  return builder.get();
}

Fixed version (ground truth):
private RpslObjectWithReplacements replaceReferences(final RpslObject mntner,final Collection<RpslObject> references){
  final Map<RpslAttribute,RpslAttribute> replacements=Maps.newHashMap();
  for (  final RpslAttribute rpslAttribute : mntner.getAttributes()) {
    for (    final RpslObject reference : references) {
      if (rpslAttribute.getCleanValue().equals(reference.getKey()) && rpslAttribute.getType().getReferences().contains(ObjectType.PERSON) || rpslAttribute.getType().getReferences().contains(ObjectType.ROLE)) {
        replacements.put(rpslAttribute,new RpslAttribute(rpslAttribute.getType(),dummyRole));
      }
    }
  }
  if (replacements.isEmpty()) {
    return new RpslObjectWithReplacements(mntner,replacements);
  }
  final RpslObjectBuilder builder=new RpslObjectBuilder(mntner);
  for (  Map.Entry<RpslAttribute,RpslAttribute> entry : replacements.entrySet()) {
    builder.replaceAttribute(entry.getKey(),entry.getValue());
  }
  return new RpslObjectWithReplacements(builder.get(),replacements);
}
Program: 160972
Project: 160972
Buggy source:
@Test public void update_modify_multiple_objects_success(){
  final RpslObject updatedPerson=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  final RpslObject updatedRole=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");
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(mapRpslObjects(updatedPerson,updatedRole),MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  System.err.println("String_Node_Str" + response.getErrorMessages());
  for (  ErrorMessage em : response.getErrorMessages()) {
    System.err.println("String_Node_Str" + em.getSeverity());
    System.err.println("String_Node_Str" + em.getText());
  }
  RestTest.assertErrorCount(response,0);
  assertThat(response.getWhoisObjects(),hasSize(2));
  assertThat(mapWhoisObjects(response.getWhoisObjects()).get(0).getValueForAttribute(AttributeType.REMARKS),is(CIString.ciString("String_Node_Str")));
  assertThat(mapWhoisObjects(response.getWhoisObjects()).get(1).getValueForAttribute(AttributeType.REMARKS),is(CIString.ciString("String_Node_Str")));
}

Fixed version (ground truth):
@Test public void update_modify_multiple_objects_success(){
  final RpslObject updatedPerson=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  final RpslObject updatedRole=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");
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(mapRpslObjects(updatedPerson,updatedRole),MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  RestTest.assertErrorCount(response,0);
  assertThat(response.getWhoisObjects(),hasSize(2));
  assertThat(mapWhoisObjects(response.getWhoisObjects()).get(0).getValueForAttribute(AttributeType.REMARKS),is(CIString.ciString("String_Node_Str")));
  assertThat(mapWhoisObjects(response.getWhoisObjects()).get(1).getValueForAttribute(AttributeType.REMARKS),is(CIString.ciString("String_Node_Str")));
}
Program: 160973
Project: 160973
Buggy source:
@Test public void update_modify_with_sso_auth_succeeds(){
  final RpslObject ssomnt=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(ssomnt);
  final WhoisResources input=mapRpslObjects(new ActionRequest(new RpslObjectBuilder(ssomnt).addAttributeSorted(new RpslAttribute(AttributeType.REMARKS,"String_Node_Str")).get(),Action.MODIFY));
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(input,MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  assertThat(getErrorMessagesWithSeverity(response.getErrorMessages(),"String_Node_Str"),hasSize(0));
  assertThat(response.getWhoisObjects(),hasSize(1));
  assertThat(objectExists(ObjectType.MNTNER,"String_Node_Str"),is(true));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
@Test public void update_modify_with_sso_auth_succeeds(){
  final RpslObject ssomnt=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  RestTest.target(getPort(),"String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").post(Entity.entity(mapRpslObjects(ssomnt),MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  final WhoisResources input=mapRpslObjects(new ActionRequest(new RpslObjectBuilder(ssomnt).addAttributeSorted(new RpslAttribute(AttributeType.REMARKS,"String_Node_Str")).get(),Action.MODIFY));
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(input,MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  assertThat(getErrorMessagesWithSeverity(response.getErrorMessages(),"String_Node_Str"),hasSize(0));
  assertThat(response.getWhoisObjects(),hasSize(1));
  assertThat(objectExists(ObjectType.MNTNER,"String_Node_Str"),is(true));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
}
Program: 160974
Project: 160974
Buggy source:
@Test public void update_delete_with_sso_auth_succeeds(){
  final RpslObject ssomnt=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  databaseHelper.addObject(ssomnt);
  final WhoisResources input=mapRpslObjects(new ActionRequest(ssomnt,Action.DELETE));
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(input,MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  assertThat(getErrorMessagesWithSeverity(response.getErrorMessages(),"String_Node_Str"),hasSize(0));
  assertThat(response.getWhoisObjects(),hasSize(1));
  assertThat(objectExists(ObjectType.MNTNER,"String_Node_Str"),is(false));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
@Test public void update_delete_with_sso_auth_succeeds(){
  final RpslObject ssomnt=RpslObject.parse("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  RestTest.target(getPort(),"String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").post(Entity.entity(mapRpslObjects(ssomnt),MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str",SyncUpdateUtils.encode("String_Node_Str")).request().put(Entity.entity(mapRpslObjects(new ActionRequest(ssomnt,Action.DELETE)),MediaType.APPLICATION_JSON_TYPE),WhoisResources.class);
  assertThat(getErrorMessagesWithSeverity(response.getErrorMessages(),"String_Node_Str"),hasSize(0));
  assertThat(response.getWhoisObjects(),hasSize(1));
  assertThat(objectExists(ObjectType.MNTNER,"String_Node_Str"),is(false));
  assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
}
Program: 160975
Project: 160975
Buggy source:
private boolean containsRpslMntner(final RpslObject rpslObject){
  if (!rpslObject.containsAttribute(AttributeType.MNT_BY)) {
    return false;
  }
  for (  RpslAttribute mntBy : rpslObject.findAttributes(AttributeType.MNT_BY)) {
    if (mntBy.getCleanValue().equals("String_Node_Str")) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean containsRpslMntner(final RpslObject rpslObject){
  if (!rpslObject.containsAttribute(AttributeType.MNT_BY)) {
    return false;
  }
  for (  RpslAttribute mntBy : rpslObject.findAttributes(AttributeType.MNT_BY)) {
    for (    CIString mntByStr : mntBy.getCleanValues()) {
      if (mntByStr.equals("String_Node_Str")) {
        return true;
      }
    }
  }
  return false;
}
Program: 160977
Project: 160977
Buggy source:
@Test public void create_self_referencing_maintainer_sso_auth_only_invalid_token(){
  try {
    RestTest.target(getPort(),"String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").post(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,SSO_ONLY_MNT),MediaType.APPLICATION_XML),WhoisResources.class);
    fail();
  }
 catch (  NotAuthorizedException e) {
    final WhoisResources whoisResources=RestTest.mapClientException(e);
    RestTest.assertErrorCount(whoisResources,2);
    RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void create_self_referencing_maintainer_sso_auth_only_invalid_token(){
  try {
    RestTest.target(getPort(),"String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").post(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,SSO_ONLY_MNT),MediaType.APPLICATION_XML),WhoisResources.class);
    fail();
  }
 catch (  NotAuthorizedException e) {
    final WhoisResources whoisResources=RestTest.mapClientException(e);
    RestTest.assertErrorCount(whoisResources,1);
    RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    RestTest.assertInfoCount(whoisResources,1);
    RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  }
}
Program: 160978
Project: 160978
Buggy source:
@Test public void update_noop_with_override(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  databaseHelper.insertUser(User.createWithPlainTextPassword("String_Node_Str","String_Node_Str",ObjectType.PERSON));
  WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,PAULETH_PALTHEN),MediaType.APPLICATION_XML),WhoisResources.class);
  RestTest.assertErrorCount(whoisResources,2);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  final WhoisObject object=whoisResources.getWhoisObjects().get(0);
  assertThat(object.getAttributes(),containsInAnyOrder(new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str",null,"String_Node_Str",new Link("String_Node_Str","String_Node_Str")),new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(whoisResources.getTermsAndConditions().getHref(),is(WhoisResources.TERMS_AND_CONDITIONS));
}

Fixed version (ground truth):
@Test public void update_noop_with_override(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  databaseHelper.insertUser(User.createWithPlainTextPassword("String_Node_Str","String_Node_Str",ObjectType.PERSON));
  WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,PAULETH_PALTHEN),MediaType.APPLICATION_XML),WhoisResources.class);
  RestTest.assertWarningCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  RestTest.assertInfoCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  final WhoisObject object=whoisResources.getWhoisObjects().get(0);
  assertThat(object.getAttributes(),containsInAnyOrder(new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str",null,"String_Node_Str",new Link("String_Node_Str","String_Node_Str")),new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(whoisResources.getTermsAndConditions().getHref(),is(WhoisResources.TERMS_AND_CONDITIONS));
}
Program: 160979
Project: 160979
Buggy source:
@Test public void update_noop(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,PAULETH_PALTHEN),MediaType.APPLICATION_XML),WhoisResources.class);
  RestTest.assertErrorCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  final WhoisObject object=whoisResources.getWhoisObjects().get(0);
  assertThat(object.getAttributes(),containsInAnyOrder(new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str",null,"String_Node_Str",new Link("String_Node_Str","String_Node_Str")),new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(whoisResources.getTermsAndConditions().getHref(),is(WhoisResources.TERMS_AND_CONDITIONS));
}

Fixed version (ground truth):
@Test public void update_noop(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,PAULETH_PALTHEN),MediaType.APPLICATION_XML),WhoisResources.class);
  RestTest.assertWarningCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  final WhoisObject object=whoisResources.getWhoisObjects().get(0);
  assertThat(object.getAttributes(),containsInAnyOrder(new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str"),new Attribute("String_Node_Str","String_Node_Str",null,"String_Node_Str",new Link("String_Node_Str","String_Node_Str")),new Attribute("String_Node_Str","String_Node_Str")));
  assertThat(whoisResources.getTermsAndConditions().getHref(),is(WhoisResources.TERMS_AND_CONDITIONS));
}
Program: 160980
Project: 160980
Buggy source:
@Test public void delete_self_referencing_maintainer_with_sso_auth_attribute_invalid_token_authenticated_with_password_succeeds() throws Exception {
  databaseHelper.addObject(SSO_AND_PASSWORD_MNT);
  final WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str","String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").delete(WhoisResources.class);
  RestTest.assertErrorCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  assertThat(whoisResources.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  try {
    databaseHelper.lookupObject(ObjectType.MNTNER,"String_Node_Str");
    fail();
  }
 catch (  EmptyResultDataAccessException ignored) {
  }
}

Fixed version (ground truth):
@Test public void delete_self_referencing_maintainer_with_sso_auth_attribute_invalid_token_authenticated_with_password_succeeds() throws Exception {
  databaseHelper.addObject(SSO_AND_PASSWORD_MNT);
  final WhoisResources whoisResources=RestTest.target(getPort(),"String_Node_Str").queryParam("String_Node_Str","String_Node_Str").request().cookie("String_Node_Str","String_Node_Str").delete(WhoisResources.class);
  RestTest.assertInfoCount(whoisResources,1);
  RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str");
  assertThat(whoisResources.getWhoisObjects(),hasSize(1));
  assertThat(whoisResources.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  try {
    databaseHelper.lookupObject(ObjectType.MNTNER,"String_Node_Str");
    fail();
  }
 catch (  EmptyResultDataAccessException ignored) {
  }
}
Program: 160982
Project: 160982
Buggy source:
@Test public void update_person_with_invalid_crowd_token_fails(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  final RpslObject updatedObject=new RpslObjectBuilder(PAULETH_PALTHEN).append(new RpslAttribute(AttributeType.REMARKS,"String_Node_Str")).sort().get();
  try {
    RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).cookie("String_Node_Str","String_Node_Str").put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,updatedObject),MediaType.APPLICATION_XML),WhoisResources.class);
    fail();
  }
 catch (  NotAuthorizedException e) {
    final WhoisResources whoisResources=RestTest.mapClientException(e);
    RestTest.assertErrorCount(whoisResources,2);
    RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void update_person_with_invalid_crowd_token_fails(){
  databaseHelper.addObject(PAULETH_PALTHEN);
  final RpslObject updatedObject=new RpslObjectBuilder(PAULETH_PALTHEN).append(new RpslAttribute(AttributeType.REMARKS,"String_Node_Str")).sort().get();
  try {
    RestTest.target(getPort(),"String_Node_Str").request(MediaType.APPLICATION_XML).cookie("String_Node_Str","String_Node_Str").put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,updatedObject),MediaType.APPLICATION_XML),WhoisResources.class);
    fail();
  }
 catch (  NotAuthorizedException e) {
    final WhoisResources whoisResources=RestTest.mapClientException(e);
    RestTest.assertErrorCount(whoisResources,1);
    RestTest.assertErrorMessage(whoisResources,0,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    RestTest.assertInfoCount(whoisResources,1);
    RestTest.assertErrorMessage(whoisResources,1,"String_Node_Str","String_Node_Str");
  }
}
Program: 160983
Project: 160983
Buggy source:
@Test public void update_person_with_non_latin_chars() throws Exception {
{
    final RpslObject update=new RpslObjectBuilder(TEST_PERSON).replaceAttribute(TEST_PERSON.findAttribute(AttributeType.ADDRESS),new RpslAttribute(AttributeType.ADDRESS,"String_Node_Str")).sort().get();
    final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").request().put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,update),MediaType.APPLICATION_XML),WhoisResources.class);
    RestTest.assertErrorCount(response,1);
    RestTest.assertErrorMessage(response,0,"String_Node_Str","String_Node_Str","String_Node_Str");
    final RpslObject lookupObject=databaseHelper.lookupObject(ObjectType.PERSON,"String_Node_Str");
    assertThat(lookupObject.findAttribute(AttributeType.ADDRESS).getValue(),is("String_Node_Str"));
  }
{
    final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").request().get(WhoisResources.class);
    assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  }
}

Fixed version (ground truth):
@Test public void update_person_with_non_latin_chars() throws Exception {
{
    final RpslObject update=new RpslObjectBuilder(TEST_PERSON).replaceAttribute(TEST_PERSON.findAttribute(AttributeType.ADDRESS),new RpslAttribute(AttributeType.ADDRESS,"String_Node_Str")).sort().get();
    final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").request().put(Entity.entity(whoisObjectMapper.mapRpslObjects(FormattedClientAttributeMapper.class,update),MediaType.APPLICATION_XML),WhoisResources.class);
    RestTest.assertWarningCount(response,1);
    RestTest.assertErrorMessage(response,0,"String_Node_Str","String_Node_Str","String_Node_Str");
    final RpslObject lookupObject=databaseHelper.lookupObject(ObjectType.PERSON,"String_Node_Str");
    assertThat(lookupObject.findAttribute(AttributeType.ADDRESS).getValue(),is("String_Node_Str"));
  }
{
    final WhoisResources response=RestTest.target(getPort(),"String_Node_Str").request().get(WhoisResources.class);
    assertThat(response.getWhoisObjects().get(0).getAttributes(),hasItem(new Attribute("String_Node_Str","String_Node_Str")));
  }
}
Program: 160988
Project: 160988
Buggy source:
public String loadSplitFiles(String... filenames){
  Result result=new Result();
  for (  String filename : filenames) {
    File file=new File(filename);
    if (!file.isFile()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    if (!file.exists()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    runPass(result,filename,1);
    runPass(result,filename,2);
  }
  result.addText(String.format("String_Node_Str",result.getSuccess(),result.getFail()));
  return result.toString();
}

Fixed version (ground truth):
public String loadSplitFiles(String... filenames){
  Result result=new Result();
  for (  String filename : filenames) {
    File file=new File(filename);
    if (!file.isFile()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    if (!file.exists()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    runPass(result,filename,1);
    runPass(result,filename,2);
  }
  result.addText(String.format("String_Node_Str",result.getSuccess(),result.getFailPass1(),result.getFailPass2()));
  return result.toString();
}
Program: 160989
Project: 160989
Buggy source:
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObject(RpslObject rpslObject,Result result,int pass){
  try {
    if (pass == 1) {
      checkForReservedNicHandle(rpslObject);
      rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
      rpslObjectUpdateDao.createObject(rpslObject);
    }
 else {
      final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
      rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
      claimIds(rpslObject);
      result.addSuccess();
    }
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter));
  }
}

Fixed version (ground truth):
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObject(RpslObject rpslObject,Result result,int pass){
  try {
    if (pass == 1) {
      checkForReservedNicHandle(rpslObject);
      rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
      rpslObjectUpdateDao.createObject(rpslObject);
    }
 else {
      final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
      rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
      claimIds(rpslObject);
      result.addSuccess();
    }
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter),pass);
  }
}
Program: 160990
Project: 160990
Buggy source:
public void addFail(String reason){
  text.append(reason);
  fail.incrementAndGet();
}

Fixed version (ground truth):
public void addFail(final String reason,final int pass){
  text.append(reason);
  if (pass == 1) {
    failPass1.incrementAndGet();
  }
  if (pass == 2) {
    failPass2.incrementAndGet();
  }
}
Program: 160992
Project: 160992
Buggy source:
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObject(RpslObject rpslObject,Result result,int pass){
  try {
    if (pass == 1) {
      rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
      rpslObjectUpdateDao.createObject(rpslObject);
    }
 else {
      final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
      rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
      claimIds(rpslObject);
      result.addSuccess();
    }
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter));
  }
}

Fixed version (ground truth):
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObject(RpslObject rpslObject,Result result,int pass){
  try {
    if (pass == 1) {
      checkForReservedNicHandle(rpslObject);
      rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
      rpslObjectUpdateDao.createObject(rpslObject);
    }
 else {
      final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
      rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
      claimIds(rpslObject);
      result.addSuccess();
    }
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter));
  }
}
Program: 160993
Project: 160993
Buggy source:
abstract void resetDatabase();

Fixed version (ground truth):
void resetDatabase();
Program: 160994
Project: 160994
Buggy source:
abstract void loadSplitFiles(Result result,String... filenames);

Fixed version (ground truth):
String loadSplitFiles(String... filenames);
Program: 160995
Project: 160995
Buggy source:
@Override protected void resetDatabase(){
  sanityCheck(whoisTemplate);
  truncateTables(whoisTemplate);
  loadScripts(whoisTemplate,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void resetDatabase(){
  sanityCheck(whoisTemplate);
  truncateTables(whoisTemplate);
  loadScripts(whoisTemplate,"String_Node_Str");
}
Program: 160996
Project: 160996
Buggy source:
@Override protected void loadSplitFiles(Result result,String... filenames){
  result.addText("String_Node_Str");
  for (  String filename : filenames) {
    File file=new File(filename);
    if (!file.isFile()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    if (!file.exists()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    runPassRisky(result,filename,1);
    runPassRisky(result,filename,2);
  }
}

Fixed version (ground truth):
@Override public String loadSplitFiles(String... filenames){
  final Result result=new Result();
  try {
    validateFiles(Arrays.asList(filenames));
    for (    String filename : filenames) {
      runPassRisky(result,filename,1);
      runPassRisky(result,filename,2);
    }
  }
 catch (  Exception e) {
    result.addText(String.format("String_Node_Str",e.getMessage()));
  }
 finally {
    result.addText(String.format("String_Node_Str",result.getSuccess(),result.getFailPass1(),result.getFailPass2()));
    if (result.getFailPass1() > 0 || result.getFailPass2() > 0) {
      result.addText("String_Node_Str");
    }
  }
  return result.toString();
}
Program: 160997
Project: 160997
Buggy source:
@Autowired public LoaderRisky(@Qualifier("String_Node_Str") final DataSource dataSource,final ObjectLoader objectLoader){
  super(dataSource,objectLoader);
}

Fixed version (ground truth):
@Autowired public LoaderRisky(@Qualifier("String_Node_Str") final DataSource dataSource,final ObjectLoader objectLoader){
  this.objectLoader=objectLoader;
  this.whoisTemplate=new JdbcTemplate(dataSource);
}
Program: 160998
Project: 160998
Buggy source:
@Override protected void resetDatabase(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void resetDatabase(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 160999
Project: 160999
Buggy source:
@Autowired public LoaderSafe(@Qualifier("String_Node_Str") final DataSource dataSource,final ObjectLoader objectLoader){
  super(dataSource,objectLoader);
}

Fixed version (ground truth):
@Autowired public LoaderSafe(final ObjectLoader objectLoader){
  this.objectLoader=objectLoader;
}
Program: 161000
Project: 161000
Buggy source:
@Override @Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) protected void loadSplitFiles(Result result,String... filenames){
  result.addText("String_Node_Str");
  for (  String filename : filenames) {
    File file=new File(filename);
    if (!file.isFile()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    if (!file.exists()) {
      result.addText(String.format("String_Node_Str",filename));
      continue;
    }
    if (file.length() > FILE_SIZE_LIMIT_IN_MB * 1024 * 1024) {
      result.addText(String.format("String_Node_Str",FILE_SIZE_LIMIT_IN_MB));
      continue;
    }
    runPassSafe(result,filename,1);
    runPassSafe(result,filename,2);
  }
}

Fixed version (ground truth):
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) private Result loadSplitFiles(final List<String> filenames){
  final Result result=new Result();
  try {
    validateFiles(filenames);
    for (    final String filename : filenames) {
      runPassSafe(result,filename,1);
      runPassSafe(result,filename,2);
    }
    return result;
  }
 catch (  Exception e) {
    throw new GetResultException(result,e);
  }
}
Program: 161001
Project: 161001
Buggy source:
private void runPassSafe(final Result result,final String filename,final int pass){
  try {
    for (    final String nextObject : new RpslObjectFileReader(filename)) {
      objectLoader.processObject(nextObject,result,pass,LoaderMode.SAFE);
    }
  }
 catch (  Exception e) {
    result.addText(String.format("String_Node_Str",filename,e.getMessage()));
  }
}

Fixed version (ground truth):
private void runPassSafe(final Result result,final String filename,final int pass){
  try {
    for (    final String nextObject : new RpslObjectFileReader(filename)) {
      objectLoader.processObject(nextObject,result,pass,LoaderMode.SAFE);
    }
  }
 catch (  IllegalArgumentException e) {
    result.addText(String.format("String_Node_Str",filename,e.getMessage()));
    throw new GetResultException(result,e);
  }
}
Program: 161002
Project: 161002
Buggy source:
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObjectRisky(RpslObject rpslObject,Result result,int pass){
  addObject(rpslObject,result,pass);
}

Fixed version (ground truth):
@Transactional(isolation=Isolation.READ_COMMITTED,propagation=Propagation.REQUIRES_NEW) public void addObjectRisky(RpslObject rpslObject,Result result,int pass){
  try {
    addObject(rpslObject,result,pass);
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter),pass);
  }
}
Program: 161003
Project: 161003
Buggy source:
private void checkForReservedNicHandle(final RpslObject object) throws ClaimException {
  if (object.getType() == ObjectType.PERSON || object.getType() == ObjectType.ROLE) {
    if (!nicHandleFactory.isAvailable(object.getKey().toString())) {
      throw new ClaimException(UpdateMessages.nicHandleNotAvailable(object.getKey()));
    }
  }
}

Fixed version (ground truth):
public void checkForReservedNicHandle(final RpslObject object) throws ClaimException {
  if (object.getType() != ObjectType.PERSON && object.getType() != ObjectType.ROLE) {
    return;
  }
  final CIString pkey=object.getKey();
  if (pkey.equals("String_Node_Str")) {
    throw new ClaimException(new Message(Messages.Type.ERROR,"String_Node_Str"));
  }
  if (!nicHandleFactory.isAvailable(object.getKey().toString())) {
    throw new ClaimException(UpdateMessages.nicHandleNotAvailable(object.getKey()));
  }
}
Program: 161004
Project: 161004
Buggy source:
private void addObject(RpslObject rpslObject,Result result,int pass){
  try {
    if (pass == 1) {
      checkForReservedNicHandle(rpslObject);
      rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
      rpslObjectUpdateDao.createObject(rpslObject);
    }
 else {
      final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
      rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
      claimIds(rpslObject);
      result.addSuccess();
    }
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter),pass);
  }
}

Fixed version (ground truth):
private void addObject(RpslObject rpslObject,Result result,int pass) throws Exception {
  if (pass == 1) {
    checkForReservedNicHandle(rpslObject);
    rpslObject=RpslObjectFilter.keepKeyAttributesOnly(new RpslObjectBuilder(rpslObject)).get();
    rpslObjectUpdateDao.createObject(rpslObject);
  }
 else {
    final RpslObjectInfo existing=rpslObjectDao.findByKey(rpslObject.getType(),rpslObject.getKey().toString());
    rpslObjectUpdateDao.updateObject(existing.getObjectId(),rpslObject);
    claimIds(rpslObject);
    result.addSuccess();
  }
}
Program: 161005
Project: 161005
Buggy source:
@Transactional(propagation=Propagation.MANDATORY) public void addObjectSafe(RpslObject rpslObject,Result result,int pass){
  addObject(rpslObject,result,pass);
}

Fixed version (ground truth):
@Transactional(propagation=Propagation.MANDATORY) private void addObjectSafe(RpslObject rpslObject,Result result,int pass){
  try {
    addObject(rpslObject,result,pass);
  }
 catch (  Exception e) {
    StringWriter stringWriter=new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    result.addFail(String.format("String_Node_Str",pass,rpslObject.getFormattedKey(),stringWriter),pass);
    throw new UpdateAbortedException();
  }
}
Program: 161006
Project: 161006
Buggy source:
@Test public void new_mode_modify_original_has_no_timestamps_input_has_wrong_timestamps(){
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.MODIFY);
  when(overrideOptions.isSkipLastModified()).thenReturn(false);
  final RpslObject input=new RpslObjectBuilder(TEMPLATE).addAttributeSorted(new RpslAttribute(AttributeType.CREATED,TIMESTAMP_STRING_OTHER)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_OTHER)).get();
  final RpslObject updatedObject=subject.generateAttributes(TEMPLATE,input,update,updateContext);
  assertThat(updatedObject.containsAttribute(AttributeType.CREATED),is(true));
  assertThat(updatedObject.findAttribute(AttributeType.LAST_MODIFIED).getValue(),is(TIMESTAMP_STRING_ACTION));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.CREATED));
  testHelper.assertAttributeMessage(updatedObject.findAttribute(AttributeType.LAST_MODIFIED),ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.LAST_MODIFIED));
}

Fixed version (ground truth):
@Test public void new_mode_modify_original_has_no_timestamps_input_has_wrong_timestamps(){
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.MODIFY);
  when(overrideOptions.isSkipLastModified()).thenReturn(false);
  final RpslObject orig=TEMPLATE;
  final RpslObject input=new RpslObjectBuilder(TEMPLATE).addAttributeSorted(new RpslAttribute(AttributeType.CREATED,TIMESTAMP_STRING_OTHER)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_OTHER)).get();
  final RpslObject updatedObject=subject.generateAttributes(orig,input,update,updateContext);
  assertThat(updatedObject.containsAttribute(AttributeType.CREATED),is(false));
  assertThat(updatedObject.findAttribute(AttributeType.LAST_MODIFIED).getValue(),is(TIMESTAMP_STRING_ACTION));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.CREATED));
  testHelper.assertAttributeMessage(updatedObject.findAttribute(AttributeType.LAST_MODIFIED),ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.LAST_MODIFIED));
}
Program: 161007
Project: 161007
Buggy source:
@Test public void new_mode_delete_original_no_timestamps_input_has_right_timestamps(){
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.DELETE);
  final RpslObject input=new RpslObjectBuilder(TEMPLATE).addAttributeSorted(new RpslAttribute(AttributeType.CREATED,TIMESTAMP_STRING_PAST)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_PAST)).get();
  final RpslObject updatedObject=subject.generateAttributes(TEMPLATE,input,update,updateContext);
  assertThat(updatedObject.containsAttribute(AttributeType.CREATED),is(true));
  assertThat(updatedObject.containsAttribute(AttributeType.LAST_MODIFIED),is(true));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.CREATED));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.LAST_MODIFIED));
}

Fixed version (ground truth):
@Test public void new_mode_delete_original_no_timestamps_input_has_right_timestamps(){
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.DELETE);
  final RpslObject original=TEMPLATE;
  final RpslObject input=new RpslObjectBuilder(TEMPLATE).addAttributeSorted(new RpslAttribute(AttributeType.CREATED,TIMESTAMP_STRING_PAST)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_PAST)).get();
  final RpslObject updatedObject=subject.generateAttributes(original,input,update,updateContext);
  assertThat(updatedObject.containsAttribute(AttributeType.CREATED),is(false));
  assertThat(updatedObject.containsAttribute(AttributeType.LAST_MODIFIED),is(false));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.CREATED));
  testHelper.assertAttributeMessage(ValidationMessages.suppliedAttributeReplacedWithGeneratedValue(AttributeType.LAST_MODIFIED));
}