nus-yam/ex-repair huggingface dataset:
Program: 161008
Project: 161008
Buggy source:
@Test public void new_mode_delete_original_no_timestamps_input_has_wrong_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_OTHER)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_OTHER)).get();
  final RpslObject updatedObject=subject.generateAttributes(original,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_wrong_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_OTHER)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_OTHER)).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));
}
Program: 161009
Project: 161009
Buggy source:
@Test public void old_mode_delete_original_has_timestamps_input_has_no_timestamps(){
  testTimestampsMode.setTimestampsOff(true);
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.DELETE);
  final RpslObject original=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,TEMPLATE,update,updateContext);
  assertThat(updatedObject.containsAttribute(AttributeType.CREATED),is(true));
  assertThat(updatedObject.containsAttribute(AttributeType.LAST_MODIFIED),is(true));
  testHelper.assertNoMessages();
}

Fixed version (ground truth):
@Test public void old_mode_delete_original_has_timestamps_input_has_no_timestamps(){
  testTimestampsMode.setTimestampsOff(true);
  testDateTimeProvider.setTime(actionTime());
  when(updateContext.getAction(update)).thenReturn(Action.DELETE);
  final RpslObject original=new RpslObjectBuilder(TEMPLATE).addAttributeSorted(new RpslAttribute(AttributeType.CREATED,TIMESTAMP_STRING_PAST)).addAttributeSorted(new RpslAttribute(AttributeType.LAST_MODIFIED,TIMESTAMP_STRING_PAST)).get();
  final RpslObject input=TEMPLATE;
  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.assertNoMessages();
}
Program: 161010
Project: 161010
Buggy source:
@Test public void no_original_object(){
  final ObjectMessages messages=validateUpdate(subject,null,OBJECT);
  assertThat(messages.getMessages().getAllMessages(),hasSize(0));
}

Fixed version (ground truth):
@Test public void no_original_object(){
  newMode();
  final ObjectMessages messages=validateUpdate(subject,null,OBJECT);
  assertThat(messages.getMessages().getAllMessages(),hasSize(0));
}
Program: 161011
Project: 161011
Buggy source:
@Test public void identical(){
  final ObjectMessages messages=validateUpdate(subject,OBJECT,OBJECT);
  assertThat(messages.getMessages().getAllMessages(),hasSize(0));
}

Fixed version (ground truth):
@Test public void identical(){
  newMode();
  final ObjectMessages messages=validateUpdate(subject,OBJECT,OBJECT);
  assertThat(messages.getMessages().getAllMessages(),hasSize(0));
}
Program: 161012
Project: 161012
Buggy source:
@Test public void not_identical(){
  final RpslObject updatedObject=RpslObject.parse("String_Node_Str");
  final ObjectMessages messages=validateUpdate(subject,OBJECT,updatedObject);
  assertThat(messages.getMessages().getAllMessages(),contains(UpdateMessages.objectMismatch(String.format("String_Node_Str",updatedObject.getType().getName(),updatedObject.getKey()))));
}

Fixed version (ground truth):
@Test public void not_identical(){
  newMode();
  final RpslObject updatedObject=RpslObject.parse("String_Node_Str");
  final ObjectMessages messages=validateUpdate(subject,OBJECT,updatedObject);
  assertThat(messages.getMessages().getAllMessages(),contains(UpdateMessages.objectMismatch(String.format("String_Node_Str",updatedObject.getType().getName(),updatedObject.getKey()))));
}
Program: 161013
Project: 161013
Buggy source:
private void generateTimestampAttributes(final RpslObjectBuilder builder,final RpslObject originalObject,final RpslObject updatedObject,final Update update,final UpdateContext updateContext){
  final Action action=updateContext.getAction(update);
  Preconditions.checkArgument(action == CREATE || action == MODIFY || action == DELETE);
  final DateTime now=dateTimeProvider.getCurrentUtcTime();
  final String nowString=now.toString(ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC));
  if (action == CREATE) {
    builder.addAttributeSorted(new RpslAttribute(CREATED,nowString));
    builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,nowString));
  }
 else   if (action == MODIFY) {
    String createdString=BEGINNING_OF_TIMES;
    if (originalObject.containsAttribute(CREATED)) {
      createdString=originalObject.getValueForAttribute(CREATED).toString();
    }
    builder.addAttributeSorted(new RpslAttribute(CREATED,createdString));
    builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,nowString));
  }
 else   if (action == DELETE) {
    if (originalObject.containsAttribute(CREATED)) {
      String createdString=originalObject.getValueForAttribute(CREATED).toString();
      builder.addAttributeSorted(new RpslAttribute(CREATED,createdString));
    }
    if (originalObject.containsAttribute(LAST_MODIFIED)) {
      String lastModifiedString=originalObject.getValueForAttribute(CREATED).toString();
      builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,lastModifiedString));
    }
  }
}

Fixed version (ground truth):
private void generateTimestampAttributes(final RpslObjectBuilder builder,final RpslObject originalObject,final RpslObject updatedObject,final Update update,final UpdateContext updateContext){
  final Action action=updateContext.getAction(update);
  Preconditions.checkArgument(action == CREATE || action == MODIFY || action == DELETE);
  final DateTime now=dateTimeProvider.getCurrentUtcTime();
  final String nowString=now.toString(ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC));
  if (action == CREATE) {
    builder.addAttributeSorted(new RpslAttribute(CREATED,nowString));
    builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,nowString));
  }
 else   if (action == MODIFY) {
    String createdString=BEGINNING_OF_TIMES;
    if (originalObject.containsAttribute(CREATED)) {
      createdString=originalObject.getValueForAttribute(CREATED).toString();
    }
    builder.addAttributeSorted(new RpslAttribute(CREATED,createdString));
    builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,nowString));
  }
 else   if (action == DELETE) {
    if (originalObject.containsAttribute(CREATED)) {
      String createdString=originalObject.getValueForAttribute(CREATED).toString();
      builder.addAttributeSorted(new RpslAttribute(CREATED,createdString));
    }
    if (originalObject.containsAttribute(LAST_MODIFIED)) {
      String lastModifiedString=originalObject.getValueForAttribute(LAST_MODIFIED).toString();
      builder.addAttributeSorted(new RpslAttribute(LAST_MODIFIED,lastModifiedString));
    }
  }
}
Program: 161014
Project: 161014
Buggy source:
public static WhoisResources unMarshalError(final InputStream inputStream){
  try {
    return (WhoisResources)unmarshaller.unmarshal(inputStream);
  }
 catch (  JAXBException e) {
    throw new StreamingException(e);
  }
}

Fixed version (ground truth):
public static WhoisResources unMarshalError(final InputStream inputStream){
  final StreamingRestClient streamingRestClient=new StreamingRestClient(inputStream);
  try {
    return (WhoisResources)streamingRestClient.unmarshaller.unmarshal(inputStream);
  }
 catch (  JAXBException e) {
    throw new StreamingException(e);
  }
}
Program: 161015
Project: 161015
Buggy source:
public StreamingRestClient(final InputStream inputStream){
  this.inputStream=inputStream;
  try {
    eventReader=xmlInputFactory.createXMLEventReader(inputStream);
    filteredReader=xmlInputFactory.createFilteredReader(eventReader,whoisObjectFilter);
  }
 catch (  XMLStreamException e) {
    throw new StreamingException(e);
  }
}

Fixed version (ground truth):
public StreamingRestClient(final InputStream inputStream){
  try {
    unmarshaller=jaxbContext.createUnmarshaller();
  }
 catch (  JAXBException e) {
    throw new StreamingException(e);
  }
  this.inputStream=inputStream;
  try {
    eventReader=xmlInputFactory.createXMLEventReader(inputStream);
    filteredReader=xmlInputFactory.createFilteredReader(eventReader,whoisObjectFilter);
  }
 catch (  XMLStreamException e) {
    throw new StreamingException(e);
  }
}
Program: 161016
Project: 161016
Buggy source:
@Ignore @Test public void concurrent_test() throws Exception {
  final AtomicInteger exceptions=new AtomicInteger();
  final ExecutorService executorService=Executors.newFixedThreadPool(NUM_THREADS);
  for (int thread=0; thread < NUM_THREADS; thread++) {
    executorService.submit(new Runnable(){
      @Override public void run(){
        final StreamingRestClient streamingRestClient=new StreamingRestClient((new ByteArrayInputStream(("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").getBytes())));
        while (streamingRestClient.hasNext()) {
          try {
            streamingRestClient.next();
          }
 catch (          Exception e) {
            exceptions.incrementAndGet();
          }
        }
      }
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(10,TimeUnit.SECONDS);
  assertThat(exceptions.get(),is(0));
}

Fixed version (ground truth):
@Test public void concurrent_test() throws Exception {
  final AtomicInteger exceptions=new AtomicInteger();
  final ExecutorService executorService=Executors.newFixedThreadPool(NUM_THREADS);
  for (int thread=0; thread < NUM_THREADS; thread++) {
    executorService.submit(new Runnable(){
      @Override public void run(){
        final StreamingRestClient streamingRestClient=new StreamingRestClient((new ByteArrayInputStream(("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").getBytes())));
        while (streamingRestClient.hasNext()) {
          try {
            streamingRestClient.next();
          }
 catch (          Exception e) {
            exceptions.incrementAndGet();
          }
        }
      }
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(10,TimeUnit.SECONDS);
  assertThat(exceptions.get(),is(0));
}
Program: 161017
Project: 161017
Buggy source:
private static SerialEntry getSerialEntryWithoutBlobs(final JdbcTemplate jdbcTemplate,final int serialId){
  return jdbcTemplate.queryForObject("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",new RowMapper<SerialEntry>(){
    @Override public SerialEntry mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return new SerialEntry(Operation.getByCode(rs.getInt(1)),rs.getBoolean(2),rs.getInt(4),rs.getInt(5));
    }
  }
,serialId);
}

Fixed version (ground truth):
private static SerialEntry getSerialEntryWithoutBlobs(final JdbcTemplate jdbcTemplate,final int serialId){
  return jdbcTemplate.queryForObject("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",new RowMapper<SerialEntry>(){
    @Override public SerialEntry mapRow(    ResultSet rs,    int rowNum) throws SQLException {
      return new SerialEntry(Operation.getByCode(rs.getInt(1)),rs.getBoolean(2),rs.getInt(4),rs.getInt(5));
    }
  }
,serialId);
}
Program: 161019
Project: 161019
Buggy source:
@Override public void run(){
  try {
    sourceContext.setCurrent(Source.master(nrtmSource.getName()));
    while (true) {
      try {
        connect();
        reader=SocketChannelFactory.createReader(socketChannel);
        writer=SocketChannelFactory.createWriter(socketChannel);
        readHeader();
        writeMirrorCommand();
        readMirrorResult();
        readUpdates();
      }
 catch (      ClosedByInterruptException e) {
        LOGGER.info("String_Node_Str");
        break;
      }
catch (      IllegalStateException e) {
        LOGGER.error(e.getMessage());
        break;
      }
catch (      IOException ignored) {
      }
catch (      RuntimeException e) {
        LOGGER.info("String_Node_Str",e);
      }
 finally {
        IOUtils.closeQuietly(socketChannel);
      }
    }
  }
  finally {
    sourceContext.removeCurrentSource();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    sourceContext.setCurrent(Source.master(nrtmSource.getName()));
    while (true) {
      try {
        connect();
        reader=SocketChannelFactory.createReader(socketChannel);
        writer=SocketChannelFactory.createWriter(socketChannel);
        readHeader();
        writeMirrorCommandAndReadResponse();
        readUpdates();
      }
 catch (      ClosedByInterruptException e) {
        LOGGER.info("String_Node_Str");
        break;
      }
catch (      IllegalStateException e) {
        LOGGER.error(e.getMessage());
        break;
      }
catch (      IOException ignored) {
      }
catch (      RuntimeException e) {
        LOGGER.info("String_Node_Str",e);
      }
 finally {
        IOUtils.closeQuietly(socketChannel);
      }
    }
  }
  finally {
    sourceContext.removeCurrentSource();
  }
}
Program: 161020
Project: 161020
Buggy source:
@Test public void gFlagRequestOutOfDateSerial(){
  when(serialDaoMock.getSerialAge(1)).thenReturn(NrtmQueryHandler.HISTORY_AGE_LIMIT + 1);
  when(messageEventMock.getMessage()).thenReturn("String_Node_Str");
  try {
    subject.messageReceived(contextMock,messageEventMock);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
    assertThat(e.getMessage(),containsString("String_Node_Str" + (NrtmQueryHandler.HISTORY_AGE_LIMIT / NrtmQueryHandler.SECONDS_PER_DAY) + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void gFlagRequestOutOfDateSerial(){
  when(serialDaoMock.getAgeOfExactOrNextExistingSerial(1)).thenReturn(Integer.valueOf(NrtmQueryHandler.HISTORY_AGE_LIMIT + 1));
  when(messageEventMock.getMessage()).thenReturn("String_Node_Str");
  try {
    subject.messageReceived(contextMock,messageEventMock);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
    assertThat(e.getMessage(),containsString("String_Node_Str" + (NrtmQueryHandler.HISTORY_AGE_LIMIT / NrtmQueryHandler.SECONDS_PER_DAY) + "String_Node_Str"));
  }
}
Program: 161022
Project: 161022
Buggy source:
@Test public void multiple_paragraphs_signed(){
  final String content="String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE;
  final ContentWithCredentials contentWithCredentials=new ContentWithCredentials(content + "String_Node_Str" + content);
  final List<Paragraph> paragraphs=subject.createParagraphs(contentWithCredentials,updateContext);
  assertThat(paragraphs,hasSize(2));
  for (  final Paragraph paragraph : paragraphs) {
    assertParagraphNoDryRun(paragraph,"String_Node_Str",new PasswordCredential("String_Node_Str"),PgpCredential.createOfferedCredential(content));
  }
}

Fixed version (ground truth):
@Test public void multiple_paragraphs_signed(){
  final String content="String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE;
  final ContentWithCredentials contentWithCredentials=new ContentWithCredentials(content + "String_Node_Str" + content);
  final List<Paragraph> paragraphs=subject.createParagraphs(contentWithCredentials,updateContext);
  assertThat(paragraphs,hasSize(2));
  for (  final Paragraph paragraph : paragraphs) {
    assertParagraphNoDryRun(paragraph,"String_Node_Str",new PasswordCredential("String_Node_Str"),PgpCredential.createOfferedCredential(content,Charsets.ISO_8859_1));
  }
}
Program: 161023
Project: 161023
Buggy source:
@Test public void single_paragraph_signed(){
  final String content="String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE;
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs,hasSize(1));
  assertParagraphNoDryRun(paragraphs.get(0),"String_Node_Str",PgpCredential.createOfferedCredential(content),new PasswordCredential("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void single_paragraph_signed(){
  final String content="String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE;
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs,hasSize(1));
  assertParagraphNoDryRun(paragraphs.get(0),"String_Node_Str",PgpCredential.createOfferedCredential(content,Charsets.ISO_8859_1),new PasswordCredential("String_Node_Str"));
}
Program: 161024
Project: 161024
Buggy source:
@Test public void multiple_paragraphs_mixed(){
  final String content1="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  final String content2="String_Node_Str";
  final String content="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE+ "String_Node_Str"+ content1+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ INPUT+ "String_Node_Str"+ SIGNATURE+ "String_Node_Str"+ content2;
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs,hasSize(4));
  final PasswordCredential pass=new PasswordCredential("String_Node_Str");
  final PasswordCredential pw=new PasswordCredential("String_Node_Str");
  final PgpCredential pgpCredential=PgpCredential.createOfferedCredential("String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE+ "String_Node_Str");
  assertParagraphNoDryRun(paragraphs.get(0),"String_Node_Str",pass,pw,pgpCredential);
  assertParagraphNoDryRun(paragraphs.get(1),"String_Node_Str",pass,pw);
  assertParagraphNoDryRun(paragraphs.get(2),"String_Node_Str",pass,pw,pgpCredential);
  assertParagraphNoDryRun(paragraphs.get(3),"String_Node_Str",pass,pw);
}

Fixed version (ground truth):
@Test public void multiple_paragraphs_mixed(){
  final String content1="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  final String content2="String_Node_Str";
  final String content="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE+ "String_Node_Str"+ content1+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ INPUT+ "String_Node_Str"+ SIGNATURE+ "String_Node_Str"+ content2;
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs,hasSize(4));
  final PasswordCredential pass=new PasswordCredential("String_Node_Str");
  final PasswordCredential pw=new PasswordCredential("String_Node_Str");
  final PgpCredential pgpCredential=PgpCredential.createOfferedCredential("String_Node_Str" + "String_Node_Str" + INPUT + "String_Node_Str"+ SIGNATURE+ "String_Node_Str",Charsets.ISO_8859_1);
  assertParagraphNoDryRun(paragraphs.get(0),"String_Node_Str",pass,pw,pgpCredential);
  assertParagraphNoDryRun(paragraphs.get(1),"String_Node_Str",pass,pw);
  assertParagraphNoDryRun(paragraphs.get(2),"String_Node_Str",pass,pw,pgpCredential);
  assertParagraphNoDryRun(paragraphs.get(3),"String_Node_Str",pass,pw);
}
Program: 161025
Project: 161025
Buggy source:
@Test public void signed_message() throws Exception {
  final String content="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";
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs.size(),is(1));
  assertThat(paragraphs.get(0).getContent(),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"));
  assertThat(paragraphs.get(0).getCredentials().all(),hasSize(1));
  assertThat(paragraphs.get(0).getCredentials().all(),containsInAnyOrder((Credential)PgpCredential.createOfferedCredential(content)));
}

Fixed version (ground truth):
@Test public void signed_message() throws Exception {
  final String content="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";
  final List<Paragraph> paragraphs=subject.createParagraphs(new ContentWithCredentials(content),updateContext);
  assertThat(paragraphs.size(),is(1));
  assertThat(paragraphs.get(0).getContent(),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"));
  assertThat(paragraphs.get(0).getCredentials().all(),hasSize(1));
  assertThat(paragraphs.get(0).getCredentials().all(),containsInAnyOrder((Credential)PgpCredential.createOfferedCredential(content,Charsets.ISO_8859_1)));
}
Program: 161026
Project: 161026
Buggy source:
@Test public void handle_multipart_post() throws Exception {
  final String data="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";
  final String help=null;
  final String nnew=null;
  final String diff=null;
  final String redirect=null;
  final String source="String_Node_Str";
  final String ssoToken="String_Node_Str";
  subject.doMultipartPost(request,source,data,help,nnew,diff,redirect,ssoToken);
  verify(messageHandler).handle(argThat(new ArgumentMatcher<UpdateRequest>(){
    @Override public boolean matches(    final Object argument){
      final UpdateRequest updateRequest=(UpdateRequest)argument;
      assertThat(updateRequest.getKeyword(),is(Keyword.NONE));
      assertThat(updateRequest.getUpdateMessage(),is(data));
      return true;
    }
  }
),argThat(new ArgumentMatcher<UpdateContext>(){
    @Override public boolean matches(    final Object argument){
      final UpdateContext updateContext=(UpdateContext)argument;
      assertThat(updateContext.getUserSession().getUsername(),is("String_Node_Str"));
      return true;
    }
  }
));
}

Fixed version (ground truth):
@Test public void handle_multipart_post() throws Exception {
  final String data="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";
  final String help=null;
  final String nnew=null;
  final String diff=null;
  final String redirect=null;
  final String source="String_Node_Str";
  final String ssoToken="String_Node_Str";
  final String contentType="String_Node_Str";
  subject.doMultipartPost(request,source,data,help,nnew,diff,redirect,contentType,ssoToken);
  verify(messageHandler).handle(argThat(new ArgumentMatcher<UpdateRequest>(){
    @Override public boolean matches(    final Object argument){
      final UpdateRequest updateRequest=(UpdateRequest)argument;
      assertThat(updateRequest.getKeyword(),is(Keyword.NONE));
      assertThat(updateRequest.getUpdateMessage(),is(data));
      return true;
    }
  }
),argThat(new ArgumentMatcher<UpdateContext>(){
    @Override public boolean matches(    final Object argument){
      final UpdateContext updateContext=(UpdateContext)argument;
      assertThat(updateContext.getUserSession().getUsername(),is("String_Node_Str"));
      return true;
    }
  }
));
}
Program: 161027
Project: 161027
Buggy source:
@Test public void handle_multipart_post_invalid_sso_token() throws Exception {
  final String data="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";
  final String help=null;
  final String nnew=null;
  final String diff=null;
  final String redirect=null;
  final String source="String_Node_Str";
  final String ssoToken="String_Node_Str";
  subject.doMultipartPost(request,source,data,help,nnew,diff,redirect,ssoToken);
  verify(messageHandler).handle(argThat(new ArgumentMatcher<UpdateRequest>(){
    @Override public boolean matches(    final Object argument){
      final UpdateRequest updateRequest=(UpdateRequest)argument;
      assertThat(updateRequest.getKeyword(),is(Keyword.NONE));
      assertThat(updateRequest.getUpdateMessage(),is(data));
      return true;
    }
  }
),argThat(new ArgumentMatcher<UpdateContext>(){
    @Override public boolean matches(    final Object argument){
      final UpdateContext updateContext=(UpdateContext)argument;
      assertThat(updateContext.getUserSession(),is(nullValue()));
      return true;
    }
  }
));
}

Fixed version (ground truth):
@Test public void handle_multipart_post_invalid_sso_token() throws Exception {
  final String data="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";
  final String help=null;
  final String nnew=null;
  final String diff=null;
  final String redirect=null;
  final String source="String_Node_Str";
  final String ssoToken="String_Node_Str";
  final String contentType="String_Node_Str";
  subject.doMultipartPost(request,source,data,help,nnew,diff,redirect,contentType,ssoToken);
  verify(messageHandler).handle(argThat(new ArgumentMatcher<UpdateRequest>(){
    @Override public boolean matches(    final Object argument){
      final UpdateRequest updateRequest=(UpdateRequest)argument;
      assertThat(updateRequest.getKeyword(),is(Keyword.NONE));
      assertThat(updateRequest.getUpdateMessage(),is(data));
      return true;
    }
  }
),argThat(new ArgumentMatcher<UpdateContext>(){
    @Override public boolean matches(    final Object argument){
      final UpdateContext updateContext=(UpdateContext)argument;
      assertThat(updateContext.getUserSession(),is(nullValue()));
      return true;
    }
  }
));
}
Program: 161028
Project: 161028
Buggy source:
@Test public void references_for_self_referenced_maintainer(){
  final WhoisVersionInternal mntnerV1=versionMapper.mapVersion(objectReferenceDao.getVersion(MNTNER,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal personV1=versionMapper.mapVersion(objectReferenceDao.getVersion(PERSON,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal orgV1=versionMapper.mapVersion(objectReferenceDao.getVersion(ORGANISATION,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal orgV2=versionMapper.mapVersion(objectReferenceDao.getVersion(ORGANISATION,"String_Node_Str",2),"String_Node_Str");
  final WhoisInternalResources whoisResources=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
  assertThat(whoisResources.getObject().getAttributes(),hasItems(new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null),new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null)));
  assertThat(whoisResources.getVersion(),is(mntnerV1));
  assertThat(whoisResources.getErrorMessages(),is(empty()));
  assertThat(whoisResources.getOutgoing().get(0),is(mntnerV1));
  assertThat(whoisResources.getIncoming(),hasItem(personV1));
  assertThat(whoisResources.getIncoming(),hasItem(mntnerV1));
}

Fixed version (ground truth):
@Test public void references_for_self_referenced_maintainer(){
  final WhoisVersionInternal mntnerV1=versionMapper.mapVersion(objectReferenceDao.getVersion(MNTNER,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal personV1=versionMapper.mapVersion(objectReferenceDao.getVersion(PERSON,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal orgV1=versionMapper.mapVersion(objectReferenceDao.getVersion(ORGANISATION,"String_Node_Str",1),"String_Node_Str");
  final WhoisVersionInternal orgV2=versionMapper.mapVersion(objectReferenceDao.getVersion(ORGANISATION,"String_Node_Str",2),"String_Node_Str");
  final WhoisInternalResources whoisResources=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
  assertThat(whoisResources.getObject().getAttributes(),hasItems(new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null),new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null)));
  assertThat(whoisResources.getVersion(),is(mntnerV1));
  assertThat(whoisResources.getErrorMessages(),is(empty()));
  assertThat(whoisResources.getOutgoing().get(0),is(mntnerV1));
  assertThat(whoisResources.getIncoming(),containsInAnyOrder(mntnerV1,personV1,orgV1,orgV2));
  assertThat(whoisResources.getIncoming(),hasItem(personV1));
  assertThat(whoisResources.getIncoming(),hasItem(mntnerV1));
}
Program: 161029
Project: 161029
Buggy source:
public void clearAndExecute(final RedisRunner runner){
  final Jedis jedis=pool.getResource();
  jedis.flushAll();
  jedis.close();
  runner.run(pool.getResource());
  pool.returnResource(jedis);
}

Fixed version (ground truth):
public void clearAndExecute(final RedisRunner runner){
  final Jedis jedis=pool.getResource();
  jedis.flushAll();
  pool.returnResource(jedis);
  runner.run(pool.getResource());
  pool.returnResource(jedis);
}
Program: 161030
Project: 161030
Buggy source:
public RevisionWithReferences(final boolean isDeleted,@CheckForNull final Set<RpslObjectReference> outgoingReferences,int revision){
  this.isDeleted=isDeleted;
  this.outgoingReferences=outgoingReferences;
  this.revision=revision;
}

Fixed version (ground truth):
public RevisionWithReferences(final boolean isDeleted,@CheckForNull final Set<RpslObjectReference> outgoingReferences,int revision){
  this.isDeleted=isDeleted;
  if (outgoingReferences != null) {
    this.outgoingReferences=outgoingReferences;
  }
 else {
    this.outgoingReferences=new HashSet<>();
  }
  this.revision=revision;
}
Program: 161031
Project: 161031
Buggy source:
public StreamingOutput streamVersions(final String key,final ObjectType type,final String source,final HttpServletRequest request){
  return new StreamingOutput(){
    @Override public void write(    final OutputStream output) throws IOException, WebApplicationException {
      final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
      final VersionsStreamHandler versionsStreamHandler=new VersionsStreamHandler(marshal,source,versionObjectMapper);
      objectReferenceDao.streamVersions(key,type,versionsStreamHandler);
      if (!versionsStreamHandler.flushHasStreamedObjects()) {
        throwNotFoundException(key,request);
      }
    }
  }
;
}

Fixed version (ground truth):
public StreamingOutput streamVersions(final String key,final ObjectType type,final String source,final HttpServletRequest request){
  return new StreamingOutput(){
    @Override public void write(    final OutputStream output) throws IOException, WebApplicationException {
      final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
      final VersionsStreamHandler versionsStreamHandler=new VersionsStreamHandler(marshal,source,versionObjectMapper);
      objectReferenceDao.streamVersions(key,type,versionsStreamHandler);
      if (!versionsStreamHandler.flushHasStreamedObjects()) {
        throwNotFoundException(request,InternalMessages.noVersions(key));
      }
    }
  }
;
}
Program: 161032
Project: 161032
Buggy source:
@Override public void write(final OutputStream output) throws IOException, WebApplicationException {
  final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
  final ReferenceStreamHandler streamHandler=new ReferenceStreamHandler(marshal,source,versionObjectMapper);
  ObjectVersion version=null;
  RpslObject rpslObject=null;
  try {
    version=objectReferenceDao.getVersion(type,key,revision);
    final List<VersionInfo> entriesInSameVersion=lookupRpslObjectByVersion(version);
    rpslObject=versionDao.getRpslObject(entriesInSameVersion.get(0));
    rpslObject=decorateRpslObject(rpslObject);
  }
 catch (  DataAccessException e) {
    throwNotFoundException(key,request);
  }
  streamHandler.streamWhoisObject(rpslObject);
  streamHandler.streamVersion(version);
  objectReferenceDao.streamIncoming(version,streamHandler);
  streamHandler.endStreamingIncoming();
  objectReferenceDao.streamOutgoing(version,streamHandler);
  streamHandler.flush();
}

Fixed version (ground truth):
@Override public void write(final OutputStream output) throws IOException, WebApplicationException {
  final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
  final ReferenceStreamHandler streamHandler=new ReferenceStreamHandler(marshal,source,versionObjectMapper);
  ObjectVersion version=null;
  RpslObject rpslObject=null;
  try {
    version=objectReferenceDao.getVersion(type,key,revision);
    final List<VersionInfo> entriesInSameVersion=lookupRpslObjectByVersion(version);
    rpslObject=versionDao.getRpslObject(entriesInSameVersion.get(0));
    rpslObject=decorateRpslObject(rpslObject);
  }
 catch (  DataAccessException e) {
    throwNotFoundException(request,InternalMessages.noVersion(key));
  }
  streamHandler.streamWhoisObject(rpslObject);
  streamHandler.streamVersion(version);
  objectReferenceDao.streamIncoming(version,streamHandler);
  streamHandler.endStreamingIncoming();
  objectReferenceDao.streamOutgoing(version,streamHandler);
  streamHandler.flush();
}
Program: 161033
Project: 161033
Buggy source:
private void throwNotFoundException(final String key,final HttpServletRequest request){
  final WhoisResources whoisResources=new WhoisResources();
  whoisResources.setErrorMessages(Lists.newArrayList(new ErrorMessage(InternalMessages.noVersions(key))));
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request)));
  whoisResources.includeTermsAndConditions();
  throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity(whoisResources).build());
}

Fixed version (ground truth):
private void throwNotFoundException(final HttpServletRequest request,Message message){
  final WhoisInternalResources whoisResources=new WhoisInternalResources();
  whoisResources.setErrorMessages(Lists.newArrayList(new ErrorMessage(message)));
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request)));
  whoisResources.includeTermsAndConditions();
  throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity(whoisResources).build());
}
Program: 161034
Project: 161034
Buggy source:
public StreamingOutput streamVersion(final ObjectType type,final String key,final String source,final Integer revision,final HttpServletRequest request){
  return new StreamingOutput(){
    @Override public void write(    final OutputStream output) throws IOException, WebApplicationException {
      final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
      final ReferenceStreamHandler streamHandler=new ReferenceStreamHandler(marshal,source,versionObjectMapper);
      ObjectVersion version=null;
      RpslObject rpslObject=null;
      try {
        version=objectReferenceDao.getVersion(type,key,revision);
        final List<VersionInfo> entriesInSameVersion=lookupRpslObjectByVersion(version);
        rpslObject=versionDao.getRpslObject(entriesInSameVersion.get(0));
        rpslObject=decorateRpslObject(rpslObject);
      }
 catch (      DataAccessException e) {
        throwNotFoundException(key,request);
      }
      streamHandler.streamWhoisObject(rpslObject);
      streamHandler.streamVersion(version);
      objectReferenceDao.streamIncoming(version,streamHandler);
      streamHandler.endStreamingIncoming();
      objectReferenceDao.streamOutgoing(version,streamHandler);
      streamHandler.flush();
    }
  }
;
}

Fixed version (ground truth):
public StreamingOutput streamVersion(final ObjectType type,final String key,final String source,final Integer revision,final HttpServletRequest request){
  return new StreamingOutput(){
    @Override public void write(    final OutputStream output) throws IOException, WebApplicationException {
      final StreamingMarshal marshal=StreamingHelper.getStreamingMarshal(request,output);
      final ReferenceStreamHandler streamHandler=new ReferenceStreamHandler(marshal,source,versionObjectMapper);
      ObjectVersion version=null;
      RpslObject rpslObject=null;
      try {
        version=objectReferenceDao.getVersion(type,key,revision);
        final List<VersionInfo> entriesInSameVersion=lookupRpslObjectByVersion(version);
        rpslObject=versionDao.getRpslObject(entriesInSameVersion.get(0));
        rpslObject=decorateRpslObject(rpslObject);
      }
 catch (      DataAccessException e) {
        throwNotFoundException(request,InternalMessages.noVersion(key));
      }
      streamHandler.streamWhoisObject(rpslObject);
      streamHandler.streamVersion(version);
      objectReferenceDao.streamIncoming(version,streamHandler);
      streamHandler.endStreamingIncoming();
      objectReferenceDao.streamOutgoing(version,streamHandler);
      streamHandler.flush();
    }
  }
;
}
Program: 161035
Project: 161035
Buggy source:
@Test public void listVersions_key_does_not_exist(){
  try {
    RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
    fail();
  }
 catch (  ClientErrorException e) {
    final String str=e.getResponse().readEntity(String.class);
    System.out.println(str);
    final WhoisInternalResources whoisResources=e.getResponse().readEntity(WhoisInternalResources.class);
    assertThat(whoisResources.getErrorMessages().get(0).toString(),is("String_Node_Str"));
    assertThat(e.getResponse().getStatus(),is(404));
  }
}

Fixed version (ground truth):
@Test public void listVersions_key_does_not_exist(){
  try {
    RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
    fail();
  }
 catch (  ClientErrorException e) {
    final WhoisInternalResources whoisResources=e.getResponse().readEntity(WhoisInternalResources.class);
    assertThat(e.getResponse().getStatus(),is(404));
    assertThat(whoisResources.getErrorMessages().get(0).toString(),is("String_Node_Str"));
  }
}
Program: 161036
Project: 161036
Buggy source:
@Test public void listVersions_created_deleted_expected_json(){
  final DateTime start=new DateTime(2008,2,20,0,0,0,0);
  final DateTime end=new DateTime(2008,2,21,0,0,0,0);
  objectReferenceDao.createVersion(new ObjectVersion(1l,ObjectType.AUT_NUM,"String_Node_Str",start,end,1));
  final String response=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON_TYPE).get(String.class);
  System.out.println(response);
  assertThat(response,is(String.format("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",dateTimeFormatter.print(start),dateTimeFormatter.print(end))));
}

Fixed version (ground truth):
@Test public void listVersions_created_deleted_expected_json(){
  final DateTime start=new DateTime(2008,2,20,0,0,0,0);
  final DateTime end=new DateTime(2008,2,21,0,0,0,0);
  objectReferenceDao.createVersion(new ObjectVersion(1l,ObjectType.AUT_NUM,"String_Node_Str",start,end,1));
  final String response=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON_TYPE).get(String.class);
  assertThat(response,is(String.format("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",dateTimeFormatter.print(start),dateTimeFormatter.print(end))));
}
Program: 161037
Project: 161037
Buggy source:
@Test public void references_for_self_referenced_maintainer(){
  final WhoisInternalResources whoisResources=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
  assertThat(whoisResources.getObject().getAttributes(),hasSize(greaterThan(1)));
  final WhoisVersionInternal expectedMntnerVersion=new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str"));
  assertThat(whoisResources.getOutgoing().get(0),is(expectedMntnerVersion));
  assertThat(whoisResources.getIncoming(),containsInAnyOrder(expectedMntnerVersion,new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str")),new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str")),new WhoisVersionInternal(2,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str"))));
}

Fixed version (ground truth):
@Test public void references_for_self_referenced_maintainer(){
  final WhoisInternalResources whoisResources=RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
  assertThat(whoisResources.getObject().getAttributes(),hasItems(new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null),new Attribute("String_Node_Str","String_Node_Str","String_Node_Str",null,null)));
  final WhoisVersionInternal expectedMntnerVersion=new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str"));
  assertThat(whoisResources.getVersion(),is(expectedMntnerVersion));
  assertThat(whoisResources.getOutgoing().get(0),is(expectedMntnerVersion));
  assertThat(whoisResources.getIncoming(),containsInAnyOrder(expectedMntnerVersion,new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str")),new WhoisVersionInternal(1,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str")),new WhoisVersionInternal(2,"String_Node_Str","String_Node_Str","String_Node_Str",null,new Link("String_Node_Str","String_Node_Str" + API_REST_RND_BASEURL + "String_Node_Str"))));
}
Program: 161038
Project: 161038
Buggy source:
public void version_not_found(){
  JdbcTestUtils.deleteFromTables(whoisTemplate,"String_Node_Str","String_Node_Str");
  try {
    RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
  }
 catch (  NotFoundException e) {
    WhoisInternalResources whoisResources=e.getResponse().readEntity(WhoisInternalResources.class);
    assertThat(whoisResources.getErrorMessages(),hasSize(1));
    assertThat(whoisResources.getErrorMessages().get(0).toString(),Is.is("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void version_not_found(){
  JdbcTestUtils.deleteFromTables(whoisTemplate,"String_Node_Str","String_Node_Str");
  try {
    RestTest.target(getPort(),"String_Node_Str",null,apiKey).request(MediaType.APPLICATION_JSON).get(WhoisInternalResources.class);
    fail();
  }
 catch (  NotFoundException e) {
    WhoisInternalResources whoisResources=e.getResponse().readEntity(WhoisInternalResources.class);
    assertThat(e.getResponse().getStatus(),is(404));
    assertThat(whoisResources.getErrorMessages(),hasSize(1));
    assertThat(whoisResources.getErrorMessages().get(0).toString(),is("String_Node_Str"));
  }
}