nus-yam/ex-repair huggingface dataset:
Program: 13105
Project: 13105
Buggy source:
@Override public void accept(BatchIterator iterator,@Nullable Throwable failure){
  delegate.accept(new ListenableBatchIterator(iterator,completionFuture),failure);
}

Fixed version (ground truth):
@Override public void accept(BatchIterator iterator,@Nullable Throwable failure){
  if (failure == null) {
    delegate.accept(new ListenableBatchIterator(iterator,completionFuture),null);
  }
 else {
    delegate.accept(null,failure);
    completionFuture.completeExceptionally(failure);
  }
}
Program: 13106
Project: 13106
Buggy source:
@Override public void accept(BatchIterator it,Throwable failure){
  if (failure == null) {
    BatchRowVisitor.visitRows(it,Collectors.mapping(Row::materialize,Collectors.toList())).whenComplete((r,t) -> {
      if (t == null) {
        result.complete(r);
      }
 else {
        result.completeExceptionally(t);
      }
      it.close();
    }
);
  }
 else {
    result.completeExceptionally(failure);
  }
}

Fixed version (ground truth):
@Override public void accept(BatchIterator it,Throwable failure){
  if (failure == null) {
    BatchRowVisitor.visitRows(it,Collectors.mapping(Row::materialize,Collectors.toList())).whenComplete((r,t) -> {
      if (t == null) {
        result.complete(r);
      }
 else {
        result.completeExceptionally(t);
      }
      it.close();
    }
);
  }
 else {
    if (it != null) {
      it.close();
    }
    result.completeExceptionally(failure);
  }
}
Program: 13110
Project: 13110
Buggy source:
@Override public ByteSizeValue extract(Settings settings){
  return settings.getAsMemory(name,defaultValue);
}

Fixed version (ground truth):
@Override public ByteSizeValue extract(Settings settings){
  return settings.getAsMemory(settingName(),defaultValue);
}
Program: 13111
Project: 13111
Buggy source:
protected IpType(){
}

Fixed version (ground truth):
IpType(){
}
Program: 13112
Project: 13112
Buggy source:
static public boolean isValid(BytesRef ip){
  if (ip.length < 7 && ip.length > 15) {
    return false;
  }
  boolean precededByZero=false;
  short symbolsInOctet=0;
  short numberOfDots=0;
  int segmentValue=0;
  for (int i=ip.offset; i < ip.length + ip.offset; i++) {
    int sym=ip.bytes[i] & 0xff;
    if (sym < 46 || sym > 57 || sym == 47) {
      return false;
    }
    if (isDigit(sym) && symbolsInOctet < 3 && !precededByZero) {
      precededByZero=(sym == 48 && symbolsInOctet == 0);
      segmentValue=segmentValue * 10 + (sym - '0');
      symbolsInOctet++;
    }
 else     if (sym == 46 && i < ip.length + ip.offset - 1) {
      numberOfDots++;
      if (numberOfDots > 3) {
        return false;
      }
      segmentValue=0;
      symbolsInOctet=0;
      precededByZero=false;
    }
 else {
      return false;
    }
    if (segmentValue > 255) {
      return false;
    }
  }
  return numberOfDots == 3;
}

Fixed version (ground truth):
static boolean isValid(BytesRef ip){
  if (ip.length < 7 || ip.length > 15) {
    return false;
  }
  boolean precededByZero=false;
  short symbolsInOctet=0;
  short numberOfDots=0;
  int segmentValue=0;
  for (int i=ip.offset; i < ip.length + ip.offset; i++) {
    int sym=ip.bytes[i] & 0xff;
    if (sym < 46 || sym > 57 || sym == 47) {
      return false;
    }
    if (isDigit(sym) && symbolsInOctet < 3 && !precededByZero) {
      precededByZero=(sym == 48 && symbolsInOctet == 0);
      segmentValue=segmentValue * 10 + (sym - '0');
      symbolsInOctet++;
    }
 else     if (sym == 46 && i < ip.length + ip.offset - 1) {
      numberOfDots++;
      if (numberOfDots > 3) {
        return false;
      }
      segmentValue=0;
      symbolsInOctet=0;
      precededByZero=false;
    }
 else {
      return false;
    }
    if (segmentValue > 255) {
      return false;
    }
  }
  return numberOfDots == 3;
}
Program: 13113
Project: 13113
Buggy source:
@Test public void testValidation() throws Exception {
  BytesRef[] validIps={new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str")};
  for (  BytesRef ip : validIps) {
    assertEquals(true,IpType.isValid(ip));
    assertEquals(true,IpType.isValid(TypeTestUtils.addOffset(ip)));
  }
  BytesRef[] invalidIps={new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str")};
  for (  BytesRef ip : invalidIps) {
    assertEquals(false,IpType.isValid(ip));
    assertEquals(false,IpType.isValid(TypeTestUtils.addOffset(ip)));
  }
}

Fixed version (ground truth):
@Test public void testValidation() throws Exception {
  BytesRef[] validIps={new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str")};
  for (  BytesRef ip : validIps) {
    assertThat(IpType.isValid(ip),is(true));
    assertThat(IpType.isValid(TypeTestUtils.addOffset(ip)),is(true));
  }
  BytesRef[] invalidIps={new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str"),new BytesRef("String_Node_Str")};
  for (  BytesRef ip : invalidIps) {
    assertThat(IpType.isValid(ip),is(false));
    assertThat(IpType.isValid(TypeTestUtils.addOffset(ip)),is(false));
  }
}
Program: 13114
Project: 13114
Buggy source:
@Override public void finish(RepeatHandle repeatHandle){
  result.set((long)rows.iterator().next()[0]);
}

Fixed version (ground truth):
@Override public void finish(RepeatHandle repeatHandle){
  result.set((Long)rows.iterator().next()[0]);
}
Program: 13115
Project: 13115
Buggy source:
public void operationFinished(@Nullable Integer operationId,@Nullable UUID jobId,@Nullable String errorMessage,long usedBytes){
  if (operationId == null || jobId == null | !isEnabled()) {
    return;
  }
  OperationContext operationContext=operationsTable.remove(uniqueOperationId(operationId,jobId));
  if (operationContext == null) {
    return;
  }
  operationContext.usedBytes=usedBytes;
  Queue<OperationContextLog> operationContextLogs=operationsLog.get();
  operationContextLogs.offer(new OperationContextLog(operationContext,errorMessage));
}

Fixed version (ground truth):
public void operationFinished(@Nullable Integer operationId,@Nullable UUID jobId,@Nullable String errorMessage,long usedBytes){
  if (operationId == null || jobId == null || !isEnabled()) {
    return;
  }
  OperationContext operationContext=operationsTable.remove(uniqueOperationId(operationId,jobId));
  if (operationContext == null) {
    return;
  }
  operationContext.usedBytes=usedBytes;
  Queue<OperationContextLog> operationContextLogs=operationsLog.get();
  operationContextLogs.offer(new OperationContextLog(operationContext,errorMessage));
}
Program: 13116
Project: 13116
Buggy source:
private void doFetch(FetchContext fetchContext,SettableFuture<IntObjectMap<StreamBucket>> resultFuture,@Nullable IntObjectMap<? extends IntContainer> toFetch) throws Exception {
}

Fixed version (ground truth):
private void doFetch(FetchContext fetchContext,SettableFuture<IntObjectMap<StreamBucket>> resultFuture,IntObjectMap<? extends IntContainer> toFetch) throws Exception {
}
Program: 13117
Project: 13117
Buggy source:
public ObjectArrayFieldType(MappedFieldType ref){
  super(ref);
}

Fixed version (ground truth):
ObjectArrayFieldType(MappedFieldType ref){
  super(ref);
}
Program: 13118
Project: 13118
Buggy source:
void jobInitializationFailed(Throwable t){
synchronized (this) {
    if (failure == null || failure instanceof InterruptedException) {
      failure=t;
    }
  }
  jobInitialized();
}

Fixed version (ground truth):
/** 
 * Indicates that a jobInitialization failed
 * @param t The cause of the initialization failure.If no failure has been set so far or if it was an InterruptedException it is overwritten.
 */
void jobInitializationFailed(Throwable t){
synchronized (this) {
    if (failure == null || failure instanceof InterruptedException) {
      failure=t;
    }
  }
  jobInitialized();
}
Program: 13119
Project: 13119
Buggy source:
@Test public void testResumeDigestBlobAddHeadAfterContent() throws IOException {
  UUID transferId=UUID.randomUUID();
  BlobContainer container=new BlobContainer(tmpFolder.newFolder().toPath());
  DigestBlob digestBlob=DigestBlob.resumeTransfer(container,"String_Node_Str",transferId,2);
  BytesArray contentTail=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addContent(contentTail,false);
  BytesArray contentHead=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addToHead(contentHead);
  contentTail=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addContent(contentTail,true);
  byte[] buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(digestBlob.file())){
    stream.read(buffer,0,15);
    assertEquals("String_Node_Str",new BytesArray(buffer).toUtf8().trim());
  }
   File file=digestBlob.commit();
  buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(file)){
    stream.read(buffer,0,15);
    assertEquals("String_Node_Str",new BytesArray(buffer).toUtf8().trim());
  }
   assertTrue(file.exists());
  assertTrue(file.delete());
}

Fixed version (ground truth):
@Test public void testResumeDigestBlobAddHeadAfterContent() throws IOException {
  UUID transferId=UUID.randomUUID();
  BlobContainer container=new BlobContainer(tmpFolder.newFolder().toPath());
  DigestBlob digestBlob=DigestBlob.resumeTransfer(container,"String_Node_Str",transferId,2);
  BytesArray contentTail=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addContent(contentTail,false);
  BytesArray contentHead=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addToHead(contentHead);
  contentTail=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addContent(contentTail,true);
  byte[] buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(digestBlob.file())){
    assertThat(stream.read(buffer,0,15),is(15));
    assertThat(new BytesArray(buffer).toUtf8().trim(),is("String_Node_Str"));
  }
   File file=digestBlob.commit();
  buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(file)){
    assertThat(stream.read(buffer,0,15),is(15));
    assertThat(new BytesArray(buffer).toUtf8().trim(),is("String_Node_Str"));
  }
   assertThat(file.exists(),is(true));
  assertThat(file.delete(),is(true));
}
Program: 13120
Project: 13120
Buggy source:
@Test public void testDigestBlobResumeHeadAndAddContent() throws IOException {
  String digest="String_Node_Str";
  UUID transferId=UUID.randomUUID();
  int currentPos=2;
  BlobContainer container=new BlobContainer(tmpFolder.newFolder().toPath());
  File filePath=new File(container.getTmpDirectory().toFile(),String.format(Locale.ENGLISH,"String_Node_Str",digest,transferId.toString()));
  if (filePath.exists()) {
    filePath.delete();
  }
  DigestBlob digestBlob=DigestBlob.resumeTransfer(container,digest,transferId,currentPos);
  BytesArray contentHead=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addToHead(contentHead);
  BytesArray contentTail=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addContent(contentTail,false);
  contentHead=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addToHead(contentHead);
  contentTail=new BytesArray("String_Node_Str".getBytes());
  digestBlob.addContent(contentTail,true);
  byte[] buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(digestBlob.file())){
    stream.read(buffer,0,15);
    assertEquals("String_Node_Str",new BytesArray(buffer).toUtf8().trim());
  }
   File file=digestBlob.commit();
  buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(file)){
    stream.read(buffer,0,15);
    assertEquals("String_Node_Str",new BytesArray(buffer).toUtf8().trim());
  }
   assertTrue(file.exists());
  assertTrue(file.delete());
}

Fixed version (ground truth):
@Test public void testDigestBlobResumeHeadAndAddContent() throws IOException {
  String digest="String_Node_Str";
  UUID transferId=UUID.randomUUID();
  int currentPos=2;
  BlobContainer container=new BlobContainer(tmpFolder.newFolder().toPath());
  File filePath=new File(container.getTmpDirectory().toFile(),String.format(Locale.ENGLISH,"String_Node_Str",digest,transferId.toString()));
  if (filePath.exists()) {
    assertThat(filePath.delete(),is(true));
  }
  DigestBlob digestBlob=DigestBlob.resumeTransfer(container,digest,transferId,currentPos);
  BytesArray contentHead=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addToHead(contentHead);
  BytesArray contentTail=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addContent(contentTail,false);
  contentHead=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addToHead(contentHead);
  contentTail=new BytesArray("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  digestBlob.addContent(contentTail,true);
  byte[] buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(digestBlob.file())){
    assertThat(stream.read(buffer,0,15),is(15));
    assertThat(new BytesArray(buffer).toUtf8().trim(),is("String_Node_Str"));
  }
   File file=digestBlob.commit();
  buffer=new byte[15];
  try (FileInputStream stream=new FileInputStream(file)){
    assertThat(stream.read(buffer,0,15),is(15));
    assertThat(new BytesArray(buffer).toUtf8().trim(),is("String_Node_Str"));
  }
   assertTrue(file.exists());
  assertTrue(file.delete());
}
Program: 13121
Project: 13121
Buggy source:
protected boolean mget(String[] uris,Header[][] headers,final String[] expectedContent) throws Throwable {
  final CountDownLatch latch=new CountDownLatch(uris.length);
  final ConcurrentHashMap<Integer,Boolean> results=new ConcurrentHashMap<>(uris.length);
  for (int i=0; i < uris.length; i++) {
    final int indexerId=i;
    final String uri=uris[indexerId];
    final Header[] header=headers[indexerId];
    final String expected=expectedContent[indexerId];
    Thread thread=new Thread(){
      @Override public void run(){
        try {
          CloseableHttpResponse res=get(uri,header);
          Integer statusCode=res.getStatusLine().getStatusCode();
          String resultContent=EntityUtils.toString(res.getEntity());
          if (!resultContent.equals(expected)) {
            logger.warn(String.format(Locale.ENGLISH,"String_Node_Str",indexerId,resultContent.length(),expected.length()));
          }
          results.put(indexerId,(statusCode >= 200 && statusCode < 300 && expected.equals(resultContent)));
        }
 catch (        Exception e) {
          logger.warn("String_Node_Str",e,indexerId);
        }
 finally {
          latch.countDown();
        }
      }
    }
;
    thread.start();
  }
  latch.await(30L,TimeUnit.SECONDS);
  return Iterables.all(results.values(),new Predicate<Boolean>(){
    @Override public boolean apply(    Boolean input){
      return input;
    }
  }
);
}

Fixed version (ground truth):
protected boolean mget(String[] uris,Header[][] headers,final String[] expectedContent) throws Throwable {
  final CountDownLatch latch=new CountDownLatch(uris.length);
  final ConcurrentHashMap<Integer,Boolean> results=new ConcurrentHashMap<>(uris.length);
  for (int i=0; i < uris.length; i++) {
    final int indexerId=i;
    final String uri=uris[indexerId];
    final Header[] header=headers[indexerId];
    final String expected=expectedContent[indexerId];
    Thread thread=new Thread(){
      @Override public void run(){
        try {
          CloseableHttpResponse res=get(uri,header);
          Integer statusCode=res.getStatusLine().getStatusCode();
          String resultContent=EntityUtils.toString(res.getEntity());
          if (!resultContent.equals(expected)) {
            logger.warn(String.format(Locale.ENGLISH,"String_Node_Str",indexerId,resultContent.length(),expected.length()));
          }
          results.put(indexerId,(statusCode >= 200 && statusCode < 300 && expected.equals(resultContent)));
        }
 catch (        Exception e) {
          logger.warn("String_Node_Str",e,indexerId);
        }
 finally {
          latch.countDown();
        }
      }
    }
;
    thread.start();
  }
  assertThat(latch.await(30L,TimeUnit.SECONDS),is(true));
  return Iterables.all(results.values(),new Predicate<Boolean>(){
    @Override public boolean apply(    Boolean input){
      return input;
    }
  }
);
}
Program: 13122
Project: 13122
Buggy source:
@Test public void testHeadRequestConnectionIsNotClosed() throws Exception {
  Socket socket=new Socket(address.getAddress(),address.getPort());
  socket.setKeepAlive(true);
  socket.setSoTimeout(3000);
  PrintWriter pw=new PrintWriter(socket.getOutputStream());
  pw.print("String_Node_Str");
  pw.print("String_Node_Str");
  pw.flush();
  BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream()));
  int linesRead=0;
  while (linesRead < 3) {
    String line=reader.readLine();
    System.out.println(line);
    linesRead++;
  }
  assertSocketIsConnected(socket);
  pw.print("String_Node_Str");
  pw.print("String_Node_Str");
  pw.flush();
  int read=reader.read();
  assertThat(read,greaterThan(-1));
  assertSocketIsConnected(socket);
}

Fixed version (ground truth):
@Test public void testHeadRequestConnectionIsNotClosed() throws Exception {
  Socket socket=new Socket(address.getAddress(),address.getPort());
  socket.setKeepAlive(true);
  socket.setSoTimeout(3000);
  OutputStream outputStream=socket.getOutputStream();
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.flush();
  BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream(),StandardCharsets.UTF_8));
  int linesRead=0;
  while (linesRead < 3) {
    String line=reader.readLine();
    System.out.println(line);
    linesRead++;
  }
  assertSocketIsConnected(socket);
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.flush();
  int read=reader.read();
  assertThat(read,greaterThan(-1));
  assertSocketIsConnected(socket);
}
Program: 13123
Project: 13123
Buggy source:
@Test public void testResponseContainsCloseHeaderOnHttp10() throws Exception {
  Socket socket=new Socket(address.getAddress(),address.getPort());
  socket.setKeepAlive(false);
  socket.setSoTimeout(3000);
  PrintWriter pw=new PrintWriter(socket.getOutputStream());
  pw.print("String_Node_Str");
  pw.print("String_Node_Str");
  pw.flush();
  BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream()));
  String line;
  List<String> lines=new ArrayList<>();
  while ((line=reader.readLine()) != null) {
    lines.add(line);
  }
  assertThat(lines,hasItem("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testResponseContainsCloseHeaderOnHttp10() throws Exception {
  Socket socket=new Socket(address.getAddress(),address.getPort());
  socket.setKeepAlive(false);
  socket.setSoTimeout(3000);
  OutputStream outputStream=socket.getOutputStream();
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.write("String_Node_Str".getBytes(StandardCharsets.UTF_8));
  outputStream.flush();
  BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream(),StandardCharsets.UTF_8));
  String line;
  List<String> lines=new ArrayList<>();
  while ((line=reader.readLine()) != null) {
    lines.add(line);
  }
  assertThat(lines,hasItem("String_Node_Str"));
}
Program: 13124
Project: 13124
Buggy source:
private String uploadFile(Client client,String content){
  byte[] digest=Blobs.digest(content);
  String digestString=Hex.encodeHexString(digest);
  byte[] contentBytes=content.getBytes();
  logger.trace("String_Node_Str",content,digestString);
  BytesArray bytes=new BytesArray(new byte[]{contentBytes[0]});
  if (content.length() == 1) {
    client.execute(StartBlobAction.INSTANCE,new StartBlobRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,bytes,true)).actionGet();
  }
 else {
    StartBlobRequest startBlobRequest=new StartBlobRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,bytes,false);
    client.execute(StartBlobAction.INSTANCE,startBlobRequest).actionGet();
    for (int i=1; i < contentBytes.length; i++) {
      try {
        Thread.sleep(timeBetweenChunks.get());
      }
 catch (      InterruptedException ex) {
        Thread.interrupted();
      }
      bytes=new BytesArray(new byte[]{contentBytes[i]});
      try {
        client.execute(PutChunkAction.INSTANCE,new PutChunkRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,startBlobRequest.transferId(),bytes,i,(i + 1) == content.length())).actionGet();
      }
 catch (      IllegalStateException ex) {
        Thread.interrupted();
      }
    }
  }
  logger.trace("String_Node_Str",content,digestString);
  return digestString;
}

Fixed version (ground truth):
private String uploadFile(Client client,String content){
  byte[] digest=Blobs.digest(content);
  String digestString=Hex.encodeHexString(digest);
  byte[] contentBytes=content.getBytes(StandardCharsets.UTF_8);
  logger.trace("String_Node_Str",content,digestString);
  BytesArray bytes=new BytesArray(new byte[]{contentBytes[0]});
  if (content.length() == 1) {
    client.execute(StartBlobAction.INSTANCE,new StartBlobRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,bytes,true)).actionGet();
  }
 else {
    StartBlobRequest startBlobRequest=new StartBlobRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,bytes,false);
    client.execute(StartBlobAction.INSTANCE,startBlobRequest).actionGet();
    for (int i=1; i < contentBytes.length; i++) {
      try {
        Thread.sleep(timeBetweenChunks.get());
      }
 catch (      InterruptedException ex) {
        Thread.interrupted();
      }
      bytes=new BytesArray(new byte[]{contentBytes[i]});
      try {
        client.execute(PutChunkAction.INSTANCE,new PutChunkRequest(BlobIndex.fullIndexName("String_Node_Str"),digest,startBlobRequest.transferId(),bytes,i,(i + 1) == content.length())).actionGet();
      }
 catch (      IllegalStateException ex) {
        Thread.interrupted();
      }
    }
  }
  logger.trace("String_Node_Str",content,digestString);
  return digestString;
}
Program: 13126
Project: 13126
Buggy source:
@Nullable public String toString(){
  return asIndexName();
}

Fixed version (ground truth):
@Override public String toString(){
  return asIndexName();
}
Program: 13127
Project: 13127
Buggy source:
@Override public void fail(@Nonnull Throwable t){
  try {
    channel.sendResponse(new CrateThrowableRestResponse(channel,t));
  }
 catch (  Throwable e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    super.fail(t);
  }
}

Fixed version (ground truth):
@Override public void fail(@Nonnull Throwable t){
  try {
    channel.sendResponse(new CrateThrowableRestResponse(channel,createSQLActionException(t)));
  }
 catch (  Throwable e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    super.fail(t);
  }
}
Program: 13128
Project: 13128
Buggy source:
@Override public void repeat(){
  try {
    Iterator<Row> iterator=pagingIterator.repeat().iterator();
    lastIterator=iterator;
    lastListener=PageConsumeListener.NO_OP_LISTENER;
    processBuckets(iterator,PageConsumeListener.NO_OP_LISTENER);
  }
 catch (  Throwable t) {
    fail(t);
  }
}

Fixed version (ground truth):
@Override public void repeat(){
  try {
    Iterator<Row> iterator=pagingIterator.repeat().iterator();
    lastIterator=iterator;
    lastListener=PageConsumeListener.NO_OP_LISTENER;
    processBuckets(iterator,PageConsumeListener.NO_OP_LISTENER);
  }
 catch (  Throwable t) {
    rowReceiver.fail(t);
  }
}
Program: 13129
Project: 13129
Buggy source:
public void repeatUpstream(){
  repeatHandle.repeat();
}

Fixed version (ground truth):
@Override public void repeatUpstream(){
  invokeFailure=true;
  super.repeatUpstream();
}
Program: 13130
Project: 13130
Buggy source:
@Override public Result setNextRow(Row row){
  Result result=super.setNextRow(row);
  numRows++;
  if (numRows == pauseAfter) {
    return Result.PAUSE;
  }
  return result;
}

Fixed version (ground truth):
@Override public Result setNextRow(Row row){
  if (invokeFailure) {
    throw new IllegalStateException("String_Node_Str");
  }
  return super.setNextRow(row);
}
Program: 13131
Project: 13131
Buggy source:
@Test public void testCopyFromFileStrictTable() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertThat(response.rowCount(),is(0L));
}

Fixed version (ground truth):
@Test public void testCopyFromFileStrictTable() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertThat(response.rowCount(),is(0L));
}
Program: 13132
Project: 13132
Buggy source:
@Test public void testCopyFromWithGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],endsWith("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromWithGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],endsWith("String_Node_Str"));
}
Program: 13133
Project: 13133
Buggy source:
@Test public void testCopyFromFileWithEmptyLine() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  File newFile=folder.newFile();
  try (BufferedWriter writer=new BufferedWriter(new FileWriter(newFile))){
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
  }
   execute("String_Node_Str",new Object[]{newFile.getPath()});
  assertEquals(2L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertThat((Integer)response.rows()[0][0],is(1));
  assertThat((Integer)response.rows()[1][0],is(2));
}

Fixed version (ground truth):
@Test public void testCopyFromFileWithEmptyLine() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  File newFile=folder.newFile();
  try (BufferedWriter writer=new BufferedWriter(new FileWriter(newFile))){
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
  }
   execute("String_Node_Str",new Object[]{Paths.get(newFile.toURI()).toUri().toString()});
  assertEquals(2L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertThat((Integer)response.rows()[0][0],is(1));
  assertThat((Integer)response.rows()[1][0],is(2));
}
Program: 13134
Project: 13134
Buggy source:
@Test public void testCopyFromFilePattern() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}

Fixed version (ground truth):
@Test public void testCopyFromFilePattern() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}
Program: 13135
Project: 13135
Buggy source:
@Test public void testCopyFromWithRoutingInPK() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  execute("String_Node_Str");
  refresh();
  String uri=Paths.get(folder.getRoot().toURI()).toString();
  SQLResponse response=execute("String_Node_Str",new Object[]{uri});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  refresh();
  execute("String_Node_Str",new Object[]{uri + "String_Node_Str"});
  refresh();
  response=execute("String_Node_Str");
  assertThat((long)response.rows()[0][0],is(1L));
}

Fixed version (ground truth):
@Test public void testCopyFromWithRoutingInPK() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  execute("String_Node_Str");
  refresh();
  String uri=Paths.get(folder.getRoot().toURI()).toUri().toString();
  SQLResponse response=execute("String_Node_Str",new Object[]{uri});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  refresh();
  execute("String_Node_Str",new Object[]{uri + "String_Node_Str"});
  refresh();
  response=execute("String_Node_Str");
  assertThat((long)response.rows()[0][0],is(1L));
}
Program: 13136
Project: 13136
Buggy source:
@Test public void testCopyFromFileWithoutPK() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertEquals(6L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(6L,response.rowCount());
  assertThat(response.rows()[0].length,is(2));
}

Fixed version (ground truth):
@Test public void testCopyFromFileWithoutPK() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertEquals(6L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(6L,response.rowCount());
  assertThat(response.rows()[0].length,is(2));
}
Program: 13137
Project: 13137
Buggy source:
@Test public void testCopyFromToPartitionedTableWithNullValue() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertNull(response.rows()[0][0]);
}

Fixed version (ground truth):
@Test public void testCopyFromToPartitionedTableWithNullValue() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertNull(response.rows()[0][0]);
}
Program: 13138
Project: 13138
Buggy source:
@Test public void testCopyFromInvalidJson() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  File newFile=folder.newFile();
  try (BufferedWriter writer=new BufferedWriter(new FileWriter(newFile))){
    writer.write("String_Node_Str");
  }
   expectedException.expect(SQLActionException.class);
  expectedException.expectMessage("String_Node_Str");
  execute("String_Node_Str",new Object[]{newFile.getPath()});
}

Fixed version (ground truth):
@Test public void testCopyFromInvalidJson() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  File newFile=folder.newFile();
  try (BufferedWriter writer=new BufferedWriter(new FileWriter(newFile))){
    writer.write("String_Node_Str");
  }
   expectedException.expect(SQLActionException.class);
  expectedException.expectMessage("String_Node_Str");
  execute("String_Node_Str",new Object[]{Paths.get(newFile.toURI()).toUri().toString()});
}
Program: 13139
Project: 13139
Buggy source:
@Test public void testCopyFromFile() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
  assertThat(response.rows()[0].length,is(2));
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromFile() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
  assertThat(response.rows()[0].length,is(2));
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],is("String_Node_Str"));
}
Program: 13140
Project: 13140
Buggy source:
@Test public void testCopyFromFileWithCompression() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  refresh();
  execute("String_Node_Str");
  assertEquals(6L,response.rowCount());
}

Fixed version (ground truth):
@Test public void testCopyFromFileWithCompression() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  refresh();
  execute("String_Node_Str");
  assertEquals(6L,response.rowCount());
}
Program: 13141
Project: 13141
Buggy source:
@Test public void testCopyFromFileWithUmlautsWhitespacesAndGlobs() throws Exception {
  execute("String_Node_Str");
  File tmpFolder=folder.newFolder("String_Node_Str");
  File file=new File(tmpFolder,"String_Node_Str");
  List<String> lines=Collections.singletonList("String_Node_Str");
  Files.write(file.toPath(),lines,StandardCharsets.UTF_8);
  execute("String_Node_Str",new Object[]{tmpFolder.getAbsolutePath() + "String_Node_Str"});
  assertThat(response.rowCount(),is(1L));
}

Fixed version (ground truth):
@Test public void testCopyFromFileWithUmlautsWhitespacesAndGlobs() throws Exception {
  execute("String_Node_Str");
  File tmpFolder=folder.newFolder("String_Node_Str");
  File file=new File(tmpFolder,"String_Node_Str");
  List<String> lines=Collections.singletonList("String_Node_Str");
  Files.write(file.toPath(),lines,StandardCharsets.UTF_8);
  execute("String_Node_Str",new Object[]{Paths.get(tmpFolder.toURI()).toUri().toString() + "String_Node_Str"});
  assertThat(response.rowCount(),is(1L));
}
Program: 13142
Project: 13142
Buggy source:
@Test public void testCopyFromTwoUriMixedSchemaAndWildcardUse() throws Exception {
  execute("String_Node_Str");
  execute("String_Node_Str");
  Path tmpDir=newTempDir(LifecycleScope.TEST);
  File file=new File(tmpDir.toFile(),"String_Node_Str");
  String r1="String_Node_Str";
  String r2="String_Node_Str";
  Files.write(file.toPath(),Collections.singletonList(r1),StandardCharsets.UTF_8);
  String[] urls={tmpDir.toAbsolutePath() + "String_Node_Str",upload("String_Node_Str",r2)};
  execute("String_Node_Str",new Object[]{urls});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  execute("String_Node_Str");
  assertThat(TestingHelpers.printedTable(response.rows()),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromTwoUriMixedSchemaAndWildcardUse() throws Exception {
  execute("String_Node_Str");
  execute("String_Node_Str");
  Path tmpDir=newTempDir(LifecycleScope.TEST);
  File file=new File(tmpDir.toFile(),"String_Node_Str");
  String r1="String_Node_Str";
  String r2="String_Node_Str";
  Files.write(file.toPath(),Collections.singletonList(r1),StandardCharsets.UTF_8);
  String[] urls={tmpDir.toUri().toString() + "String_Node_Str",upload("String_Node_Str",r2)};
  execute("String_Node_Str",new Object[]{urls});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  execute("String_Node_Str");
  assertThat(TestingHelpers.printedTable(response.rows()),is("String_Node_Str"));
}
Program: 13143
Project: 13143
Buggy source:
@Test public void testCopyFromToPartitionedTableWithGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],endsWith("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromToPartitionedTableWithGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],endsWith("String_Node_Str"));
}
Program: 13144
Project: 13144
Buggy source:
@Test public void testCopyFromNestedArrayRow() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(nestedArrayCopyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertEquals(1L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertThat(TestingHelpers.printedTable(response.rows()),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromNestedArrayRow() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{nestedArrayCopyFilePath + "String_Node_Str"});
  assertEquals(1L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertThat(TestingHelpers.printedTable(response.rows()),is("String_Node_Str"));
}
Program: 13145
Project: 13145
Buggy source:
@Test public void testCopyFromIntoPartitionWithInvalidGivenGeneratedColumnAsPartitionKey() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  assertThat(response.rowCount(),is(3L));
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(3L));
}

Fixed version (ground truth):
@Test public void testCopyFromIntoPartitionWithInvalidGivenGeneratedColumnAsPartitionKey() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertThat(response.rowCount(),is(3L));
  refresh();
  execute("String_Node_Str");
  assertThat(response.rowCount(),is(3L));
}
Program: 13146
Project: 13146
Buggy source:
@Test public void testCopyFromDirectory() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  String uriPath=Joiner.on("String_Node_Str").join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{uriPath});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}

Fixed version (ground truth):
@Test public void testCopyFromDirectory() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertEquals(3L,response.rowCount());
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}
Program: 13147
Project: 13147
Buggy source:
@Test public void testCopyFromWithInvalidGivenGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  assertThat(response.rowCount(),is(3L));
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCopyFromWithInvalidGivenGeneratedColumn() throws Exception {
  execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  assertThat(response.rowCount(),is(3L));
  refresh();
  execute("String_Node_Str");
  assertThat((String)response.rows()[0][0],is("String_Node_Str"));
}
Program: 13148
Project: 13148
Buggy source:
@Test public void testCopyFromWithOverwriteDuplicates() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[][]{new Object[]{1},new Object[]{2},new Object[]{3},new Object[]{4}});
  execute("String_Node_Str");
  File tmpExport=folder.newFolder("String_Node_Str");
  execute("String_Node_Str",new Object[]{tmpExport.getAbsolutePath()});
  assertThat(response.rowCount(),is(4L));
  execute("String_Node_Str",new Object[]{String.format(Locale.ENGLISH,"String_Node_Str",tmpExport.getAbsolutePath())});
  assertThat(response.rowCount(),is(0L));
  execute("String_Node_Str",new Object[]{String.format(Locale.ENGLISH,"String_Node_Str",tmpExport.getAbsolutePath())});
  assertThat(response.rowCount(),is(4L));
  execute("String_Node_Str");
  execute("String_Node_Str");
  assertThat(((Long)response.rows()[0][0]),is(4L));
}

Fixed version (ground truth):
@Test public void testCopyFromWithOverwriteDuplicates() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  execute("String_Node_Str",new Object[][]{new Object[]{1},new Object[]{2},new Object[]{3},new Object[]{4}});
  execute("String_Node_Str");
  File tmpExport=folder.newFolder("String_Node_Str");
  String uriTemplate=Paths.get(tmpExport.toURI()).toUri().toString();
  execute("String_Node_Str",new Object[]{uriTemplate});
  assertThat(response.rowCount(),is(4L));
  execute("String_Node_Str",new Object[]{uriTemplate + "String_Node_Str"});
  assertThat(response.rowCount(),is(0L));
  execute("String_Node_Str",new Object[]{uriTemplate + "String_Node_Str"});
  assertThat(response.rowCount(),is(4L));
  execute("String_Node_Str");
  execute("String_Node_Str");
  assertThat(((Long)response.rows()[0][0]),is(4L));
}
Program: 13149
Project: 13149
Buggy source:
@Test public void testCopyFromFileWithPartition() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  String filePath=Joiner.on(File.separator).join(copyFilePath,"String_Node_Str");
  execute("String_Node_Str",new Object[]{filePath});
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}

Fixed version (ground truth):
@Test public void testCopyFromFileWithPartition() throws Exception {
  execute("String_Node_Str" + "String_Node_Str");
  ensureGreen();
  execute("String_Node_Str",new Object[]{copyFilePath + "String_Node_Str"});
  refresh();
  execute("String_Node_Str");
  assertEquals(3L,response.rowCount());
}
Program: 13151
Project: 13151
Buggy source:
@Test @UseJdbc(false) public void testCopyFromEmptyStringRouting() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  execute("String_Node_Str");
  refresh();
  String uri=Paths.get(folder.getRoot().toURI()).toString();
  SQLResponse response=execute("String_Node_Str",new Object[]{uri});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  refresh();
  execute("String_Node_Str",new Object[]{uri + "String_Node_Str"});
  refresh();
  response=execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertThat((long)response.rows()[0][1],is(2L));
}

Fixed version (ground truth):
@Test @UseJdbc(false) public void testCopyFromEmptyStringRouting() throws Exception {
  execute("String_Node_Str");
  ensureYellow();
  execute("String_Node_Str");
  refresh();
  String uri=Paths.get(folder.getRoot().toURI()).toUri().toString();
  SQLResponse response=execute("String_Node_Str",new Object[]{uri});
  assertThat(response.rowCount(),is(2L));
  execute("String_Node_Str");
  refresh();
  execute("String_Node_Str",new Object[]{uri + "String_Node_Str"});
  refresh();
  response=execute("String_Node_Str");
  assertThat(response.rowCount(),is(1L));
  assertThat((long)response.rows()[0][1],is(2L));
}
Program: 13152
Project: 13152
Buggy source:
@Test public void testKillCopyTo() throws Exception {
  String path=temporaryFolder.newFolder().getAbsolutePath();
  setup.setUpEmployees();
  assertGotCancelled("String_Node_Str",new Object[]{path},true);
}

Fixed version (ground truth):
@Test public void testKillCopyTo() throws Exception {
  String path=Paths.get(temporaryFolder.newFolder().toURI()).toUri().toString();
  setup.setUpEmployees();
  assertGotCancelled("String_Node_Str",new Object[]{path},true);
}
Program: 13153
Project: 13153
Buggy source:
@Override public void prepare(){
  if (!prepared) {
    prepared=true;
    delegate.prepare();
  }
}

Fixed version (ground truth):
@Override public void prepare(){
  if (numFinishCalls.get() == 0) {
    downstream.prepare();
  }
}
Program: 13154
Project: 13154
Buggy source:
@Override public Set<Requirement> requirements(){
  return delegate.requirements();
}

Fixed version (ground truth):
@Override public Set<Requirement> requirements(){
  return downstream.requirements();
}
Program: 13155
Project: 13155
Buggy source:
@Override public void kill(Throwable throwable){
  listener.onFailure(throwable);
  delegate.kill(throwable);
}

Fixed version (ground truth):
@Override public void kill(Throwable throwable){
  if (numFinishCalls.get() != -1) {
    downstream.kill(throwable);
  }
}
Program: 13156
Project: 13156
Buggy source:
@Override public void fail(Throwable throwable){
  this.failure=throwable;
  countdown();
  listener.onFailure(throwable);
}

Fixed version (ground truth):
@Override public void fail(Throwable throwable){
  downstream.fail(throwable);
}
Program: 13157
Project: 13157
Buggy source:
@Override public void doCollect(){
  if (collectorsIt.hasNext()) {
    CrateCollector collector=collectorsIt.next();
    LOGGER.trace("String_Node_Str",collector);
    collector.doCollect();
  }
}

Fixed version (ground truth):
@Override public void doCollect(){
  collectors.get(0).doCollect();
}
Program: 13158
Project: 13158
Buggy source:
@Override public Result setNextRow(Row row){
  return delegate.setNextRow(row);
}

Fixed version (ground truth):
@Override public Result setNextRow(Row row){
  return downstream.setNextRow(row);
}
Program: 13159
Project: 13159
Buggy source:
@Override public void repeat(){
  if (MultiRowReceiver.this.activeUpstreams.compareAndSet(0,repeatHandles.size())) {
    for (    RepeatHandle repeatHandle : repeatHandles) {
      repeatHandle.repeat();
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void repeat(){
}