nus-yam/ex-repair huggingface dataset:
Program: 166550
Project: 166550
Buggy source:
public DDF getDDFByUri(String uri) throws DDFException {
  UUID uuid=this.mUris.get(uri);
  if (uuid != null) {
    throw new DDFException(String.format("String_Node_Str",uri));
  }
  return this.getDDF(uuid);
}

Fixed version (ground truth):
public DDF getDDFByUri(String uri) throws DDFException {
  UUID uuid=this.mUris.get(uri);
  if (uuid == null) {
    throw new DDFException(String.format("String_Node_Str",uri));
  }
  return this.getDDF(uuid);
}
Program: 166551
Project: 166551
Buggy source:
@Override public DDF updateInplace(DDF newddf) throws DDFException {
  DDF curDDF=this.getDDF();
  curDDF.getRepresentationHandler().reset();
  curDDF.getRepresentationHandler().setRepresentations(newddf.getRepresentationHandler().getAllRepresentations());
  newddf.getManager().removeDDF(curDDF);
  newddf.getMetaDataHandler().copyMetaData(curDDF);
  curDDF.getSchemaHandler().setSchema(newddf.getSchema());
  return curDDF;
}

Fixed version (ground truth):
@Override public DDF updateInplace(DDF newddf) throws DDFException {
  DDF curDDF=this.getDDF();
  curDDF.getRepresentationHandler().reset();
  curDDF.getRepresentationHandler().setRepresentations(newddf.getRepresentationHandler().getAllRepresentations());
  curDDF.getSchemaHandler().setSchema(newddf.getSchema());
  return curDDF;
}
Program: 166552
Project: 166552
Buggy source:
public DDF getFlattenedDDF() throws DDFException {
  return Transform.flattenDDF();
}

Fixed version (ground truth):
public DDF getFlattenedDDF() throws DDFException {
  return this.getTransformationHandler().flattenDDF();
}
Program: 166553
Project: 166553
Buggy source:
public static String RToSqlUdf(String RExp){
  return RToSqlUdf(RExp,null);
}

Fixed version (ground truth):
public static String RToSqlUdf(String RExp){
  return RToSqlUdf(RExp,null,null);
}
Program: 166554
Project: 166554
Buggy source:
@Override public DDF sql2ddf(String command,Schema schema,String dataSource,DataFormat dataFormat) throws DDFException {
  DataFrame rdd=null;
  if (dataSource == null) {
    rdd=this.getHiveContext().sql(command);
  }
 else {
  }
  if (schema == null)   schema=SchemaHandler.getSchemaFromDataFrame(rdd);
  DDF ddf=this.getManager().newDDF(this.getManager(),rdd,new Class<?>[]{DataFrame.class},null,tableName,schema);
  ((SparkDDF)ddf).saveAsTable();
  return ddf;
}

Fixed version (ground truth):
@Override public DDF sql2ddf(String command,Schema schema,String dataSource,DataFormat dataFormat) throws DDFException {
  DataFrame rdd=null;
  if (dataSource == null) {
    rdd=this.getHiveContext().sql(command);
  }
 else {
  }
  if (schema == null)   schema=SchemaHandler.getSchemaFromDataFrame(rdd);
  DDF ddf=this.getManager().newDDF(this.getManager(),rdd,new Class<?>[]{DataFrame.class},null,null,schema);
  return ddf;
}
Program: 166555
Project: 166555
Buggy source:
public String setUUID(String uuid){
  this.uuid=uuid;
}

Fixed version (ground truth):
public void setUUID(String uuid){
  this.uuid=uuid;
}
Program: 166556
Project: 166556
Buggy source:
@Override public void unpersist(String namespace,String name) throws DDFException {
  this.getDDF().beforeUnpersisting();
  Utils.deleteFile(this.getDataFileName(namespace,name));
  Utils.deleteFile(this.getSchemaFileName(namespace,name));
  this.getDDF().afterUnpersisting();
}

Fixed version (ground truth):
@Override public void unpersist(String namespace,String name) throws DDFException {
  this.getDDF().beforeUnpersisting();
  try {
    Utils.deleteFile(this.getDataFileName(namespace,name));
    Utils.deleteFile(this.getSchemaFileName(namespace,name));
  }
 catch (  Exception e) {
    throw new DDFException(e);
  }
  this.getDDF().afterUnpersisting();
}
Program: 166557
Project: 166557
Buggy source:
@Override public List<HistogramBin> getVectorHistogram(String columnName,int numBins) throws DDFException {
  String command=String.format("String_Node_Str",columnName,numBins);
  if (!Strings.isNullOrEmpty(command)) {
    mLog.info("String_Node_Str" + command);
    List<String> result=this.getDDF().sql2txt(command,String.format("String_Node_Str",columnName));
    if (result != null && !result.isEmpty() && result.get(0) != null) {
      List<HistogramBin> bins=Lists.newArrayList();
      mLog.info("String_Node_Str" + result.get(0));
      String[] arrayString=result.get(0).replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str");
      for (      String str : arrayString) {
        HistogramBin bin=new HistogramBin();
        String[] xy=str.split("String_Node_Str");
        bin.setX(Double.parseDouble(xy[0]));
        bin.setY(Double.parseDouble(xy[1]));
        bins.add(bin);
      }
      return bins;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public List<HistogramBin> getVectorHistogram(String columnName,int numBins) throws DDFException {
  String command=String.format("String_Node_Str",columnName,numBins);
  if (!Strings.isNullOrEmpty(command)) {
    mLog.info("String_Node_Str" + command);
    List<String> result=this.getDDF().sql2txt(command,String.format("String_Node_Str",columnName));
    if (result != null && !result.isEmpty() && result.get(0) != null) {
      List<HistogramBin> bins=Lists.newArrayList();
      mLog.info("String_Node_Str" + result.get(0));
      String[] arrayString=result.get(0).replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str");
      int i=0;
      while (i < numBins) {
        HistogramBin bin=new HistogramBin();
        bin.setX(Double.parseDouble(arrayString[i * 2 + 0]));
        bin.setX(Double.parseDouble(arrayString[i * 2 + 1]));
        i+=1;
        bins.add(bin);
      }
      return bins;
    }
  }
  return null;
}
Program: 166563
Project: 166563
Buggy source:
@Override public void remove(final Handler handler,final Item item) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final File _parentDriveItem=_getHistoryFolder(item);
      if (_parentDriveItem != null) {
        final ParentReference parentReference=new ParentReference();
        parentReference.setId(_parentDriveItem.getId());
        File driveItem=new File();
        driveItem.setParents(Arrays.asList(parentReference));
        driveItem=service.files().patch(item.getRemoteIdentifier(),driveItem).execute();
        if (driveItem == null) {
          throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
        }
      }
 else {
        service.files().delete(item.getRemoteIdentifier()).execute();
      }
      _removeFromCache(item.getRemoteIdentifier());
      return;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
    }
  }
 while (true);
}

Fixed version (ground truth):
@Override public void remove(final Handler handler,final Item item) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final File _parentDriveItem=_getHistoryFolder(item);
      if (_parentDriveItem != null) {
        final ParentReference parentReference=new ParentReference();
        parentReference.setId(_parentDriveItem.getId());
        File driveItem=new File();
        driveItem.setParents(Arrays.asList(parentReference));
        driveItem=service.files().patch(item.getRemoteIdentifier(),driveItem).execute();
        if (driveItem == null) {
          throw new CloudsyncException("String_Node_Str" + item.getPath() + "String_Node_Str");
        }
      }
 else {
        service.files().delete(item.getRemoteIdentifier()).execute();
      }
      _removeFromCache(item.getRemoteIdentifier());
      return;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
      if (retryCount < 0)       retryCount=0;
    }
  }
 while (true);
}
Program: 166564
Project: 166564
Buggy source:
@Override public List<RemoteItem> readFolder(final Handler handler,final Item parentItem) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final List<RemoteItem> child_items=new ArrayList<RemoteItem>();
      final List<File> childDriveItems=_readFolder(parentItem.getRemoteIdentifier());
      for (      final File child : childDriveItems) {
        child_items.add(_prepareBackupItem(parentItem,child,handler));
      }
      return child_items;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",parentItem,e,retryCount);
    }
  }
 while (true);
}

Fixed version (ground truth):
@Override public List<RemoteItem> readFolder(final Handler handler,final Item parentItem) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final List<RemoteItem> child_items=new ArrayList<RemoteItem>();
      final List<File> childDriveItems=_readFolder(parentItem.getRemoteIdentifier());
      for (      final File child : childDriveItems) {
        child_items.add(_prepareBackupItem(parentItem,child,handler));
      }
      return child_items;
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",parentItem,e,retryCount);
      if (retryCount < 0)       retryCount=0;
    }
  }
 while (true);
}
Program: 166565
Project: 166565
Buggy source:
@Override public InputStream get(final Handler handler,final Item item) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final File driveItem=_getDriveItem(item);
      final String downloadUrl=driveItem.getDownloadUrl();
      final HttpResponse resp=service.getRequestFactory().buildGetRequest(new GenericUrl(downloadUrl)).execute();
      return resp.getContent();
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
    }
  }
 while (true);
}

Fixed version (ground truth):
@Override public InputStream get(final Handler handler,final Item item) throws CloudsyncException {
  initService(handler);
  int retryCount=0;
  do {
    try {
      refreshCredential();
      final File driveItem=_getDriveItem(item);
      final String downloadUrl=driveItem.getDownloadUrl();
      final HttpResponse resp=service.getRequestFactory().buildGetRequest(new GenericUrl(downloadUrl)).execute();
      return resp.getContent();
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",item,e,retryCount);
      if (retryCount < 0)       retryCount=0;
    }
  }
 while (true);
}
Program: 166566
Project: 166566
Buggy source:
private File _searchDriveItem(final Item parentItem,String title) throws CloudsyncException {
  int retryCount=0;
  do {
    try {
      final String q="String_Node_Str" + title + "String_Node_Str"+ parentItem.getRemoteIdentifier()+ "String_Node_Str";
      final Drive.Files.List request=service.files().list();
      request.setQ(q);
      final List<File> result=request.execute().getItems();
      return result.size() == 0 ? null : result.get(0);
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",parentItem,e,retryCount);
    }
  }
 while (true);
}

Fixed version (ground truth):
private File _searchDriveItem(final Item parentItem,String title) throws CloudsyncException {
  int retryCount=0;
  do {
    try {
      final String q="String_Node_Str" + title + "String_Node_Str"+ parentItem.getRemoteIdentifier()+ "String_Node_Str";
      final Drive.Files.List request=service.files().list();
      request.setQ(q);
      final List<File> result=request.execute().getItems();
      return result.size() == 0 ? null : result.get(0);
    }
 catch (    final IOException e) {
      retryCount=validateException("String_Node_Str",parentItem,e,retryCount);
      if (retryCount < 0)       retryCount=0;
    }
  }
 while (true);
}
Program: 166568
Project: 166568
Buggy source:
private static Transaction.VisibilityLevel getVisibilityLevel(TVisibilityLevel tLevel){
switch (tLevel) {
case SNAPSHOT:
    return Transaction.VisibilityLevel.SNAPSHOT;
case SNAPSHOT_EXCLUDE_CURRENT:
  return Transaction.VisibilityLevel.SNAPSHOT_EXCLUDE_CURRENT;
default :
throw new IllegalArgumentException("String_Node_Str" + tLevel);
}
}

Fixed version (ground truth):
private static Transaction.VisibilityLevel getVisibilityLevel(TVisibilityLevel tLevel){
  if (tLevel == null) {
    return Transaction.VisibilityLevel.SNAPSHOT;
  }
switch (tLevel) {
case SNAPSHOT:
    return Transaction.VisibilityLevel.SNAPSHOT;
case SNAPSHOT_EXCLUDE_CURRENT:
  return Transaction.VisibilityLevel.SNAPSHOT_EXCLUDE_CURRENT;
default :
throw new IllegalArgumentException("String_Node_Str" + tLevel);
}
}
Program: 166569
Project: 166569
Buggy source:
public static Transaction unwrap(TTransaction thriftTx){
  return new Transaction(thriftTx.getReadPointer(),thriftTx.getTransactionId(),thriftTx.getWritePointer(),Longs.toArray(thriftTx.getInvalids()),Longs.toArray(thriftTx.getInProgress()),thriftTx.getFirstShort(),getTransactionType(thriftTx.getType()),Longs.toArray(thriftTx.getCheckpointWritePointers()),getVisibilityLevel(thriftTx.getVisibilityLevel()));
}

Fixed version (ground truth):
public static Transaction unwrap(TTransaction thriftTx){
  return new Transaction(thriftTx.getReadPointer(),thriftTx.getTransactionId(),thriftTx.getWritePointer(),thriftTx.getInvalids() == null ? EMPTY_LONG_ARRAY : Longs.toArray(thriftTx.getInvalids()),thriftTx.getInProgress() == null ? EMPTY_LONG_ARRAY : Longs.toArray(thriftTx.getInProgress()),thriftTx.getFirstShort(),getTransactionType(thriftTx.getType()),thriftTx.getCheckpointWritePointers() == null ? EMPTY_LONG_ARRAY : Longs.toArray(thriftTx.getCheckpointWritePointers()),getVisibilityLevel(thriftTx.getVisibilityLevel()));
}
Program: 166570
Project: 166570
Buggy source:
@Override public String toString(){
  return Objects.toStringHelper(this).add("String_Node_Str",visibilityUpperBound).add("String_Node_Str",expiration).add("String_Node_Str",type).toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return Objects.toStringHelper(this).add("String_Node_Str",visibilityUpperBound).add("String_Node_Str",expiration).add("String_Node_Str",type).add("String_Node_Str",checkpointWritePointers).toString();
}
Program: 166571
Project: 166571
Buggy source:
@Override protected NavigableMap<Long,TransactionManager.InProgressTx> decodeInProgress(BinaryDecoder decoder) throws IOException {
  int size=decoder.readInt();
  NavigableMap<Long,TransactionManager.InProgressTx> inProgress=Maps.newTreeMap();
  while (size != 0) {
    for (int remaining=size; remaining > 0; --remaining) {
      long txId=decoder.readLong();
      long expiration=decoder.readLong();
      long visibilityUpperBound=decoder.readLong();
      int txTypeIdx=decoder.readInt();
      TransactionType txType;
      try {
        txType=TransactionType.values()[txTypeIdx];
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        throw new IOException("String_Node_Str" + txTypeIdx);
      }
      int checkpointPointerSize=decoder.readInt();
      LongArrayList checkpointPointers=new LongArrayList(checkpointPointerSize);
      while (checkpointPointerSize != 0) {
        for (int checkpointRemaining=checkpointPointerSize; checkpointRemaining > 0; --checkpointRemaining) {
          checkpointPointers.add(decoder.readLong());
        }
        size=decoder.readInt();
      }
      inProgress.put(txId,new TransactionManager.InProgressTx(visibilityUpperBound,expiration,txType,checkpointPointers));
    }
    size=decoder.readInt();
  }
  return inProgress;
}

Fixed version (ground truth):
@Override protected NavigableMap<Long,TransactionManager.InProgressTx> decodeInProgress(BinaryDecoder decoder) throws IOException {
  int size=decoder.readInt();
  NavigableMap<Long,TransactionManager.InProgressTx> inProgress=Maps.newTreeMap();
  while (size != 0) {
    for (int remaining=size; remaining > 0; --remaining) {
      long txId=decoder.readLong();
      long expiration=decoder.readLong();
      long visibilityUpperBound=decoder.readLong();
      int txTypeIdx=decoder.readInt();
      TransactionType txType;
      try {
        txType=TransactionType.values()[txTypeIdx];
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        throw new IOException("String_Node_Str" + txTypeIdx);
      }
      int checkpointPointerSize=decoder.readInt();
      LongArrayList checkpointPointers=new LongArrayList(checkpointPointerSize);
      while (checkpointPointerSize != 0) {
        for (int checkpointRemaining=checkpointPointerSize; checkpointRemaining > 0; --checkpointRemaining) {
          checkpointPointers.add(decoder.readLong());
        }
        checkpointPointerSize=decoder.readInt();
      }
      inProgress.put(txId,new TransactionManager.InProgressTx(visibilityUpperBound,expiration,txType,checkpointPointers));
    }
    size=decoder.readInt();
  }
  return inProgress;
}
Program: 166572
Project: 166572
Buggy source:
@Override protected void encodeInProgress(BinaryEncoder encoder,Map<Long,TransactionManager.InProgressTx> inProgress) throws IOException {
  if (!inProgress.isEmpty()) {
    encoder.writeInt(inProgress.size());
    for (    Map.Entry<Long,TransactionManager.InProgressTx> entry : inProgress.entrySet()) {
      encoder.writeLong(entry.getKey());
      encoder.writeLong(entry.getValue().getExpiration());
      encoder.writeLong(entry.getValue().getVisibilityUpperBound());
      encoder.writeInt(entry.getValue().getType().ordinal());
      LongArrayList checkpointPointers=entry.getValue().getCheckpointWritePointers();
      if (checkpointPointers == null && !checkpointPointers.isEmpty()) {
        encoder.writeInt(checkpointPointers.size());
        for (int i=0; i < checkpointPointers.size(); i++) {
          encoder.writeLong(checkpointPointers.getLong(i));
        }
      }
      encoder.writeInt(0);
    }
  }
  encoder.writeInt(0);
}

Fixed version (ground truth):
@Override protected void encodeInProgress(BinaryEncoder encoder,Map<Long,TransactionManager.InProgressTx> inProgress) throws IOException {
  if (!inProgress.isEmpty()) {
    encoder.writeInt(inProgress.size());
    for (    Map.Entry<Long,TransactionManager.InProgressTx> entry : inProgress.entrySet()) {
      encoder.writeLong(entry.getKey());
      encoder.writeLong(entry.getValue().getExpiration());
      encoder.writeLong(entry.getValue().getVisibilityUpperBound());
      encoder.writeInt(entry.getValue().getType().ordinal());
      LongArrayList checkpointPointers=entry.getValue().getCheckpointWritePointers();
      if (checkpointPointers != null && !checkpointPointers.isEmpty()) {
        encoder.writeInt(checkpointPointers.size());
        for (int i=0; i < checkpointPointers.size(); i++) {
          encoder.writeLong(checkpointPointers.getLong(i));
        }
      }
      encoder.writeInt(0);
    }
  }
  encoder.writeInt(0);
}
Program: 166574
Project: 166574
Buggy source:
public boolean isDeleted(Cell cell){
  return cell.getTimestamp() < familyDeleteTs;
}

Fixed version (ground truth):
public boolean isDeleted(Cell cell){
  return cell.getTimestamp() <= familyDeleteTs;
}
Program: 166576
Project: 166576
Buggy source:
public boolean isDeleted(Cell cell){
  return cell.getTimestamp() < familyDeleteTs;
}

Fixed version (ground truth):
public boolean isDeleted(Cell cell){
  return cell.getTimestamp() <= familyDeleteTs;
}
Program: 166578
Project: 166578
Buggy source:
/** 
 * Check if in-progress transactions need to be migrated to have expiration time and type, if so do the migration. This is required for backwards compatibility, when long running transactions were represented with expiration time -1. This can be removed when we stop supporting SnapshotCodec version 1.
 */
private Map<Long,InProgressTx> txnBackwardsCompatCheck(Map<Long,InProgressTx> inProgress){
  for (  Map.Entry<Long,InProgressTx> entry : inProgress.entrySet()) {
    if (entry.getValue().getExpiration() < 0) {
      long writePointer=entry.getKey();
      long expiration=getTxExpirationFromWritePointer(writePointer,defaultLongTimeout);
      InProgressTx compatTx=new InProgressTx(entry.getValue().getVisibilityUpperBound(),expiration,TransactionType.LONG);
      entry.setValue(compatTx);
    }
 else     if (entry.getValue().getType() == null) {
      InProgressTx compatTx=new InProgressTx(entry.getValue().getVisibilityUpperBound(),entry.getValue().getExpiration(),TransactionType.SHORT);
      entry.setValue(compatTx);
    }
  }
  return inProgress;
}

Fixed version (ground truth):
/** 
 * Check if in-progress transactions need to be migrated to have expiration time and type, if so do the migration. This is required for backwards compatibility, when long running transactions were represented with expiration time -1. This can be removed when we stop supporting SnapshotCodec version 1.
 */
public static Map<Long,InProgressTx> txnBackwardsCompatCheck(int defaultLongTimeout,long longTimeoutTolerance,Map<Long,InProgressTx> inProgress){
  for (  Map.Entry<Long,InProgressTx> entry : inProgress.entrySet()) {
    long writePointer=entry.getKey();
    long expiration=entry.getValue().getExpiration();
    if (entry.getValue().getType() == null && (expiration < 0 || (getTxExpirationFromWritePointer(writePointer,defaultLongTimeout) - expiration < longTimeoutTolerance))) {
      long newExpiration=getTxExpirationFromWritePointer(writePointer,defaultLongTimeout);
      InProgressTx compatTx=new InProgressTx(entry.getValue().getVisibilityUpperBound(),newExpiration,TransactionType.LONG);
      entry.setValue(compatTx);
    }
 else     if (entry.getValue().getType() == null) {
      InProgressTx compatTx=new InProgressTx(entry.getValue().getVisibilityUpperBound(),entry.getValue().getExpiration(),TransactionType.SHORT);
      entry.setValue(compatTx);
    }
  }
  return inProgress;
}
Program: 166579
Project: 166579
Buggy source:
/** 
 * Restore the initial in-memory transaction state from a snapshot.
 */
private void restoreSnapshot(TransactionSnapshot snapshot){
  LOG.info("String_Node_Str" + snapshot.getTimestamp());
  Preconditions.checkState(lastSnapshotTime == 0,"String_Node_Str");
  Preconditions.checkState(readPointer == 0,"String_Node_Str");
  Preconditions.checkState(lastWritePointer == 0,"String_Node_Str");
  Preconditions.checkState(invalid.isEmpty(),"String_Node_Str");
  Preconditions.checkState(inProgress.isEmpty(),"String_Node_Str");
  Preconditions.checkState(committingChangeSets.isEmpty(),"String_Node_Str");
  Preconditions.checkState(committedChangeSets.isEmpty(),"String_Node_Str");
  LOG.info("String_Node_Str" + snapshot);
  lastSnapshotTime=snapshot.getTimestamp();
  readPointer=snapshot.getReadPointer();
  lastWritePointer=snapshot.getWritePointer();
  invalid.addAll(snapshot.getInvalid());
  inProgress.putAll(txnBackwardsCompatCheck(snapshot.getInProgress()));
  committingChangeSets.putAll(snapshot.getCommittingChangeSets());
  committedChangeSets.putAll(snapshot.getCommittedChangeSets());
}

Fixed version (ground truth):
/** 
 * Restore the initial in-memory transaction state from a snapshot.
 */
private void restoreSnapshot(TransactionSnapshot snapshot){
  LOG.info("String_Node_Str" + snapshot.getTimestamp());
  Preconditions.checkState(lastSnapshotTime == 0,"String_Node_Str");
  Preconditions.checkState(readPointer == 0,"String_Node_Str");
  Preconditions.checkState(lastWritePointer == 0,"String_Node_Str");
  Preconditions.checkState(invalid.isEmpty(),"String_Node_Str");
  Preconditions.checkState(inProgress.isEmpty(),"String_Node_Str");
  Preconditions.checkState(committingChangeSets.isEmpty(),"String_Node_Str");
  Preconditions.checkState(committedChangeSets.isEmpty(),"String_Node_Str");
  LOG.info("String_Node_Str" + snapshot);
  lastSnapshotTime=snapshot.getTimestamp();
  readPointer=snapshot.getReadPointer();
  lastWritePointer=snapshot.getWritePointer();
  invalid.addAll(snapshot.getInvalid());
  inProgress.putAll(txnBackwardsCompatCheck(defaultLongTimeout,longTimeoutTolerance,snapshot.getInProgress()));
  committingChangeSets.putAll(snapshot.getCommittingChangeSets());
  committedChangeSets.putAll(snapshot.getCommittedChangeSets());
}
Program: 166580
Project: 166580
Buggy source:
@Inject public TransactionManager(Configuration conf,@Nonnull TransactionStateStorage persistor,TxMetricsCollector txMetricsCollector){
  this.persistor=persistor;
  cleanupInterval=conf.getInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL,TxConstants.Manager.DEFAULT_TX_CLEANUP_INTERVAL);
  defaultTimeout=conf.getInt(TxConstants.Manager.CFG_TX_TIMEOUT,TxConstants.Manager.DEFAULT_TX_TIMEOUT);
  defaultLongTimeout=conf.getInt(TxConstants.Manager.CFG_TX_LONG_TIMEOUT,TxConstants.Manager.DEFAULT_TX_LONG_TIMEOUT);
  snapshotFrequencyInSeconds=conf.getLong(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_INTERVAL);
  snapshotRetainCount=Math.max(conf.getInt(TxConstants.Manager.CFG_TX_SNAPSHOT_RETAIN,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_RETAIN),1);
  this.txMetricsCollector=txMetricsCollector;
  clear();
}

Fixed version (ground truth):
@Inject public TransactionManager(Configuration conf,@Nonnull TransactionStateStorage persistor,TxMetricsCollector txMetricsCollector){
  this.persistor=persistor;
  cleanupInterval=conf.getInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL,TxConstants.Manager.DEFAULT_TX_CLEANUP_INTERVAL);
  defaultTimeout=conf.getInt(TxConstants.Manager.CFG_TX_TIMEOUT,TxConstants.Manager.DEFAULT_TX_TIMEOUT);
  defaultLongTimeout=conf.getInt(TxConstants.Manager.CFG_TX_LONG_TIMEOUT,TxConstants.Manager.DEFAULT_TX_LONG_TIMEOUT);
  snapshotFrequencyInSeconds=conf.getLong(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_INTERVAL);
  snapshotRetainCount=Math.max(conf.getInt(TxConstants.Manager.CFG_TX_SNAPSHOT_RETAIN,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_RETAIN),1);
  longTimeoutTolerance=conf.getLong("String_Node_Str",10000);
  this.txMetricsCollector=txMetricsCollector;
  clear();
}
Program: 166581
Project: 166581
Buggy source:
private static long getTxExpirationFromWritePointer(long writePointer,long timeoutInSeconds){
  return writePointer / TxConstants.MAX_TX_PER_MS + TimeUnit.SECONDS.toMillis(timeoutInSeconds);
}

Fixed version (ground truth):
public static long getTxExpirationFromWritePointer(long writePointer,long timeoutInSeconds){
  return writePointer / TxConstants.MAX_TX_PER_MS + TimeUnit.SECONDS.toMillis(timeoutInSeconds);
}
Program: 166582
Project: 166582
Buggy source:
/** 
 * Returns the maximum timestamp to use for time-range operations, based on the given transaction.
 * @param tx The current transaction
 * @return The maximum timestamp (exclusive) to use for time-range operations
 */
public static long getMaxVisibleTimestamp(Transaction tx){
  return tx.getWritePointer() + 1;
}

Fixed version (ground truth):
/** 
 * Returns the maximum timestamp to use for time-range operations, based on the given transaction.
 * @param tx The current transaction
 * @return The maximum timestamp (exclusive) to use for time-range operations
 */
public static long getMaxVisibleTimestamp(Transaction tx){
  return tx.getWritePointer() < Long.MAX_VALUE ? tx.getWritePointer() + 1 : tx.getWritePointer();
}
Program: 166583
Project: 166583
Buggy source:
protected Configuration getSnapshotConfiguration() throws IOException {
  Configuration conf=HBaseConfiguration.create();
  conf.unset(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES);
  return conf;
}

Fixed version (ground truth):
protected Configuration getSnapshotConfiguration() throws IOException {
  Configuration conf=HBaseConfiguration.create(hConf);
  conf.unset(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES);
  return conf;
}
Program: 166584
Project: 166584
Buggy source:
/** 
 * Try to initialize the Configuration and TransactionStateStorage instances.  Obtaining the Configuration may fail until ReactorServiceMain has been started.
 */
private void tryInit(){
  try {
    Configuration conf=getSnapshotConfiguration();
    if (conf != null) {
      this.storage=new HDFSTransactionStateStorage(hConf,new SnapshotCodecProvider(conf));
      this.storage.startAndWait();
      this.snapshotRefreshFrequency=conf.getLong(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_INTERVAL) * 1000;
      this.initialized=true;
    }
 else {
      LOG.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.info("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Try to initialize the Configuration and TransactionStateStorage instances.  Obtaining the Configuration may fail until ReactorServiceMain has been started.
 */
private void tryInit(){
  try {
    Configuration conf=getSnapshotConfiguration();
    if (conf != null) {
      this.storage=new HDFSTransactionStateStorage(conf,new SnapshotCodecProvider(conf));
      this.storage.startAndWait();
      this.snapshotRefreshFrequency=conf.getLong(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL,TxConstants.Manager.DEFAULT_TX_SNAPSHOT_INTERVAL) * 1000;
      this.initialized=true;
    }
 else {
      LOG.info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.info("String_Node_Str" + e.getMessage());
  }
}
Program: 166585
Project: 166585
Buggy source:
/** 
 * Returns a singleton instance of the transaction state cache, performing lazy initialization if necessary.
 * @return A shared instance of the transaction state cache.
 */
@Override public TransactionStateCache get(){
  if (instance == null) {
synchronized (lock) {
      if (instance == null) {
        instance=new TransactionStateCache();
        instance.setConf(conf);
        instance.startAndWait();
      }
    }
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Returns a singleton instance of the transaction state cache, performing lazy initialization if necessary.
 * @return A shared instance of the transaction state cache.
 */
@Override public TransactionStateCache get(){
  if (instance == null) {
synchronized (lock) {
      if (instance == null) {
        instance=new TransactionStateCache();
        instance.setConf(conf);
        instance.start();
      }
    }
  }
  return instance;
}
Program: 166586
Project: 166586
Buggy source:
@Override public ProcessingDirective heartbeat(){
  final long timeMillis=System.currentTimeMillis();
  return currentTrackedFile.map(trackedFile -> {
    handleHeartbeatWithHealthyFileSystem(timeMillis);
    return CONTINUE;
  }
).orElseGet(() -> {
    handleHeartbeatWithDeadFileSystem(timeMillis);
    return PAUSE;
  }
);
}

Fixed version (ground truth):
@Override public ProcessingDirective heartbeat(){
  final long timeMillis=System.currentTimeMillis();
  return currentTrackedFile.map(trackedFile -> {
    return handleHeartbeatWithHealthyFileSystem(timeMillis);
  }
).orElseGet(() -> {
    return timeMillis - lastFixAttempt > reconnectDelay ? attemptRecovery(timeMillis) : PAUSE;
  }
);
}
Program: 166587
Project: 166587
Buggy source:
private void possiblySyncAndOrRoll(final long time) throws IOException {
  final TrackedFile trackedFile=currentTrackedFile.get();
  if (trackedFile.recordsSinceLastSync >= syncEveryRecords || time - trackedFile.lastSyncTime >= syncEveryMillis && trackedFile.recordsSinceLastSync > 0) {
    sync(time,trackedFile);
    possiblyRoll(time);
  }
 else   if (trackedFile.recordsSinceLastSync == 0) {
    trackedFile.lastSyncTime=time;
    possiblyRoll(time);
  }
}

Fixed version (ground truth):
private void possiblySyncAndOrRoll(final long time) throws IOException {
  final TrackedFile trackedFile=currentTrackedFile.get();
  if (time > trackedFile.projectedCloseTime) {
    if (trackedFile.totalRecords > 0) {
      trackedFile.divolteFile.closeAndPublish();
    }
 else {
      trackedFile.divolteFile.discard();
    }
    currentTrackedFile=Optional.of(new TrackedFile(manager.createFile(newFileName())));
  }
 else   if (trackedFile.recordsSinceLastSync >= syncEveryRecords || time - trackedFile.lastSyncTime >= syncEveryMillis && trackedFile.recordsSinceLastSync > 0) {
    sync(time,trackedFile);
  }
 else   if (trackedFile.recordsSinceLastSync == 0) {
    trackedFile.lastSyncTime=time;
  }
}
Program: 166588
Project: 166588
Buggy source:
private void handleHeartbeatWithHealthyFileSystem(final long timeMillis){
  try {
    possiblySyncAndOrRoll(timeMillis);
  }
 catch (  final IOException e) {
    markFileSystemUnavailable(timeMillis);
    logger.error("String_Node_Str" + reconnectDelay + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private ProcessingDirective handleHeartbeatWithHealthyFileSystem(final long timeMillis){
  try {
    possiblySyncAndOrRoll(timeMillis);
    return CONTINUE;
  }
 catch (  final IOException e) {
    markFileSystemUnavailable(timeMillis);
    logger.error("String_Node_Str" + reconnectDelay + "String_Node_Str",e);
    return PAUSE;
  }
}
Program: 166589
Project: 166589
Buggy source:
private void attemptRecovery(final long timeMillis){
  logger.info("String_Node_Str");
  try {
    final TrackedFile trackedFile=new TrackedFile(manager.createFile(newFileName()));
    currentTrackedFile=Optional.of(trackedFile);
    logger.info("String_Node_Str",trackedFile);
  }
 catch (  final IOException e) {
    logger.error("String_Node_Str" + reconnectDelay + "String_Node_Str",e);
    markFileSystemUnavailable(timeMillis);
  }
}

Fixed version (ground truth):
private ProcessingDirective attemptRecovery(final long timeMillis){
  logger.info("String_Node_Str");
  try {
    final TrackedFile trackedFile=new TrackedFile(manager.createFile(newFileName()));
    currentTrackedFile=Optional.of(trackedFile);
    logger.info("String_Node_Str",trackedFile);
    return CONTINUE;
  }
 catch (  final IOException e) {
    logger.error("String_Node_Str" + reconnectDelay + "String_Node_Str",e);
    markFileSystemUnavailable(timeMillis);
    return PAUSE;
  }
}
Program: 166590
Project: 166590
Buggy source:
public static TrackingJavaScriptResource create(final ValidatedConfiguration vc,final String sourceName) throws IOException {
  final BrowserSourceConfiguration browserSourceConfiguration=vc.configuration().getSourceConfiguration(sourceName,BrowserSourceConfiguration.class);
  return new TrackingJavaScriptResource(browserSourceConfiguration.javascript.name,createScriptConstants(browserSourceConfiguration),browserSourceConfiguration.javascript.debug);
}

Fixed version (ground truth):
public static TrackingJavaScriptResource create(final ValidatedConfiguration vc,final String sourceName) throws IOException {
  final BrowserSourceConfiguration browserSourceConfiguration=vc.configuration().getSourceConfiguration(sourceName,BrowserSourceConfiguration.class);
  return new TrackingJavaScriptResource("String_Node_Str",createScriptConstants(browserSourceConfiguration),browserSourceConfiguration.javascript.debug);
}
Program: 166591
Project: 166591
Buggy source:
public SchemaRegistry(final ValidatedConfiguration vc){
  final ImmutableMap<String,MappingConfiguration> mappings=vc.configuration().mappings;
  final ImmutableMap<String,Optional<String>> schemaLocationsByMapping=ImmutableMap.copyOf(Maps.transformValues(mappings,config -> config.schemaFile));
  logger.debug("String_Node_Str",schemaLocationsByMapping.keySet());
  final ImmutableMap<Optional<String>,Schema> schemasByLocation=schemaLocationsByMapping.values().stream().distinct().map(schemaLocation -> Maps.immutableEntry(schemaLocation,loadSchema(schemaLocation))).collect(MoreCollectors.toImmutableMap());
  schemasByMappingName=ImmutableMap.copyOf(Maps.transformValues(schemaLocationsByMapping,schemasByLocation::get));
  logger.info("String_Node_Str",schemasByMappingName.keySet());
  schemasBySinkName=mappings.values().stream().flatMap(config -> config.sinks.stream().map(sink -> Maps.immutableEntry(sink,schemasByLocation.get(config.schemaFile)))).collect(MoreCollectors.toImmutableMap());
  logger.info("String_Node_Str",schemasBySinkName.keySet());
}

Fixed version (ground truth):
public SchemaRegistry(final ValidatedConfiguration vc){
  final ImmutableMap<String,MappingConfiguration> mappings=vc.configuration().mappings;
  final ImmutableMap<String,Optional<String>> schemaLocationsByMapping=ImmutableMap.copyOf(Maps.transformValues(mappings,config -> config.schemaFile));
  logger.debug("String_Node_Str",schemaLocationsByMapping.keySet());
  final ImmutableMap<Optional<String>,Schema> schemasByLocation=schemaLocationsByMapping.values().stream().distinct().map(schemaLocation -> Maps.immutableEntry(schemaLocation,loadSchema(schemaLocation))).collect(MoreCollectors.toImmutableMap());
  schemasByMappingName=ImmutableMap.copyOf(Maps.transformValues(schemaLocationsByMapping,schemasByLocation::get));
  logger.info("String_Node_Str",schemasByMappingName.keySet());
  schemasBySinkName=mappings.values().stream().flatMap(config -> config.sinks.stream().map(sink -> Maps.immutableEntry(sink,schemasByLocation.get(config.schemaFile)))).distinct().collect(MoreCollectors.toImmutableMap());
  logger.info("String_Node_Str",schemasBySinkName.keySet());
}
Program: 166593
Project: 166593
Buggy source:
@Override public ProcessingDirective process(final HttpServerExchange exchange){
  final GenericRecord avroRecord=mapper.newRecordFromExchange(exchange);
  final AvroRecordBuffer avroBuffer=AvroRecordBuffer.fromRecord(exchange.getAttachment(PARTY_COOKIE_KEY),exchange.getAttachment(SESSION_COOKIE_KEY),exchange.getAttachment(REQUEST_START_TIME_KEY),exchange.getAttachment(COOKIE_UTC_OFFSET_KEY),avroRecord);
  final int requestHashCode=Objects.hash(exchange.getAttachment(PARTY_COOKIE_KEY),exchange.getAttachment(SESSION_COOKIE_KEY),exchange.getAttachment(PAGE_VIEW_ID_KEY),exchange.getAttachment(EVENT_ID_KEY));
  final boolean duplicate=memory.observeAndReturnDuplicity(requestHashCode);
  if (duplicate) {
    if (logger.isDebugEnabled()) {
      final String queryString=exchange.getQueryString();
      final String requestUrl=exchange.getRequestURL();
      final String fullUrl=Strings.isNullOrEmpty(queryString) ? requestUrl : requestUrl + '?' + queryString;
      logger.debug("String_Node_Str",exchange.getSourceAddress(),fullUrl);
    }
    if (keepDuplicates) {
      exchange.putAttachment(DUPLICATE_EVENT_KEY,true);
      doProcess(exchange,avroRecord,avroBuffer);
    }
  }
 else {
    exchange.putAttachment(DUPLICATE_EVENT_KEY,false);
    doProcess(exchange,avroRecord,avroBuffer);
  }
  return CONTINUE;
}

Fixed version (ground truth):
@Override public ProcessingDirective process(final HttpServerExchange exchange){
  final int requestHashCode=Objects.hash(exchange.getAttachment(PARTY_COOKIE_KEY),exchange.getAttachment(SESSION_COOKIE_KEY),exchange.getAttachment(PAGE_VIEW_ID_KEY),exchange.getAttachment(EVENT_ID_KEY));
  final boolean duplicate=memory.observeAndReturnDuplicity(requestHashCode);
  exchange.putAttachment(DUPLICATE_EVENT_KEY,duplicate);
  final GenericRecord avroRecord=mapper.newRecordFromExchange(exchange);
  final AvroRecordBuffer avroBuffer=AvroRecordBuffer.fromRecord(exchange.getAttachment(PARTY_COOKIE_KEY),exchange.getAttachment(SESSION_COOKIE_KEY),exchange.getAttachment(REQUEST_START_TIME_KEY),exchange.getAttachment(COOKIE_UTC_OFFSET_KEY),avroRecord);
  if (!duplicate || keepDuplicates) {
    doProcess(exchange,avroRecord,avroBuffer);
  }
  return CONTINUE;
}
Program: 166594
Project: 166594
Buggy source:
@Test public void shouldCastValueFromComplexMappingToSchemaType() throws IOException, UnirestException {
  Schema schema=schemaFromClassPath("String_Node_Str");
  Config config=ConfigFactory.load("String_Node_Str");
  RecordMapper maker=new RecordMapper(schema,config,ConfigFactory.load(),Optional.empty());
  setupExchange("String_Node_Str","String_Node_Str","String_Node_Str");
  GenericRecord record=maker.newRecordFromExchange(theExchange);
  assertEquals(Integer.valueOf(-42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(true),record.get("String_Node_Str"));
  assertEquals(Double.valueOf(3.14159265359),record.get("String_Node_Str"));
  assertEquals(Long.valueOf(34359738368L),record.get("String_Node_Str"));
  assertEquals(Integer.valueOf(42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(false),record.get("String_Node_Str"));
  assertEquals(Double.valueOf(3.14159265359),record.get("String_Node_Str"));
  assertEquals(Long.valueOf(34359738368L),record.get("String_Node_Str"));
  assertEquals(Integer.valueOf(42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(true),record.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldCastValueFromComplexMappingToSchemaType() throws IOException, UnirestException {
  Schema schema=schemaFromClassPath("String_Node_Str");
  Config config=ConfigFactory.load("String_Node_Str");
  RecordMapper maker=new RecordMapper(schema,config,ConfigFactory.load(),Optional.empty());
  setupExchange("String_Node_Str","String_Node_Str","String_Node_Str");
  GenericRecord record=maker.newRecordFromExchange(theExchange);
  assertEquals(Integer.valueOf(-42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(true),record.get("String_Node_Str"));
  assertEquals(Double.valueOf(1.6180339887498948482),record.get("String_Node_Str"));
  assertEquals(Long.valueOf(34359738368L),record.get("String_Node_Str"));
  assertEquals(Integer.valueOf(42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(false),record.get("String_Node_Str"));
  assertEquals(Double.valueOf(1.6180339887498948482),record.get("String_Node_Str"));
  assertEquals(Long.valueOf(34359738368L),record.get("String_Node_Str"));
  assertEquals(Integer.valueOf(42),record.get("String_Node_Str"));
  assertEquals(Boolean.valueOf(true),record.get("String_Node_Str"));
}
Program: 166595
Project: 166595
Buggy source:
@Override public ProcessingDirective process(AvroRecordBuffer record){
  if (lastHdfsResult == SUCCESS) {
    lastHdfsResult=fileStrategy.append(record);
  }
  return CONTINUE;
}

Fixed version (ground truth):
@Override public ProcessingDirective process(AvroRecordBuffer record){
  if (lastHdfsResult == SUCCESS) {
    return (lastHdfsResult=fileStrategy.append(record)) == SUCCESS ? CONTINUE : PAUSE;
  }
 else {
    return PAUSE;
  }
}
Program: 166596
Project: 166596
Buggy source:
private Optional<String> groupFromMatcher(final Matcher matcher,final String group){
  return matcher.matches() ? Optional.of(matcher.group(group)) : Optional.empty();
}

Fixed version (ground truth):
private Optional<String> groupFromMatcher(final Matcher matcher,final String group){
  return matcher.matches() ? Optional.ofNullable(matcher.group(group)) : Optional.empty();
}
Program: 166597
Project: 166597
Buggy source:
private void deleteQuietly(Path p){
  try {
    Files.delete(p);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
private void deleteQuietly(Path p){
  try {
    Files.delete(p);
  }
 catch (  final Exception e) {
    logger.debug("String_Node_Str" + p,e);
  }
}
Program: 166598
Project: 166598
Buggy source:
public GenericRecordMaker(Schema schema,Config config){
  Objects.requireNonNull(config);
  this.partyIdCookie=config.getString("String_Node_Str");
  this.sessionIdCookie=config.getString("String_Node_Str");
  this.pageViewIdCookie=config.getString("String_Node_Str");
  final int version=config.getInt("String_Node_Str");
  checkVersion(version);
  this.regexes=regexMapFromConfig(config);
  this.setters=setterListFromConfig(config);
  this.schema=Objects.requireNonNull(schema);
}

Fixed version (ground truth):
public GenericRecordMaker(Schema schema,Config schemaConfig,Config globalConfig){
  Objects.requireNonNull(schemaConfig);
  Objects.requireNonNull(globalConfig);
  this.partyIdCookie=globalConfig.getString("String_Node_Str");
  this.sessionIdCookie=globalConfig.getString("String_Node_Str");
  this.pageViewIdCookie=globalConfig.getString("String_Node_Str");
  final int version=schemaConfig.getInt("String_Node_Str");
  checkVersion(version);
  this.regexes=regexMapFromConfig(schemaConfig);
  this.setters=setterListFromConfig(schemaConfig);
  this.schema=Objects.requireNonNull(schema);
}
Program: 166599
Project: 166599
Buggy source:
public IncomingRequestProcessingPool(final Config config){
  final int numThreads=config.getInt("String_Node_Str");
  final ThreadGroup threadGroup=new ThreadGroup("String_Node_Str");
  final ThreadFactory factory=createThreadFactory(threadGroup,"String_Node_Str");
  final ExecutorService executorService=Executors.newFixedThreadPool(numThreads,factory);
  final Schema schema=schemaFromConfig(config);
  final KafkaFlushingPool kafkaFlushingPool=config.getBoolean("String_Node_Str") ? new KafkaFlushingPool(config) : null;
  final HdfsFlushingPool hdfsFlushingPool=config.getBoolean("String_Node_Str") ? new HdfsFlushingPool(config,schema) : null;
  final Config schemaMappingConfig;
  if (config.hasPath("String_Node_Str")) {
    logger.info("String_Node_Str");
    schemaMappingConfig=config;
  }
 else {
    logger.info("String_Node_Str");
    schemaMappingConfig=ConfigFactory.load("String_Node_Str");
  }
  this.processors=Stream.generate(() -> new IncomingRequestProcessor(schemaMappingConfig,kafkaFlushingPool,hdfsFlushingPool,schema)).limit(numThreads).collect(Collectors.toCollection(() -> new ArrayList<>(numThreads)));
  this.processors.forEach((processor) -> scheduleQueueReader(executorService,processor.getQueueReader()));
}

Fixed version (ground truth):
public IncomingRequestProcessingPool(final Config config){
  final int numThreads=config.getInt("String_Node_Str");
  final ThreadGroup threadGroup=new ThreadGroup("String_Node_Str");
  final ThreadFactory factory=createThreadFactory(threadGroup,"String_Node_Str");
  final ExecutorService executorService=Executors.newFixedThreadPool(numThreads,factory);
  final Schema schema=schemaFromConfig(config);
  final KafkaFlushingPool kafkaFlushingPool=config.getBoolean("String_Node_Str") ? new KafkaFlushingPool(config) : null;
  final HdfsFlushingPool hdfsFlushingPool=config.getBoolean("String_Node_Str") ? new HdfsFlushingPool(config,schema) : null;
  this.processors=Stream.generate(() -> new IncomingRequestProcessor(config,kafkaFlushingPool,hdfsFlushingPool,schema)).limit(numThreads).collect(Collectors.toCollection(() -> new ArrayList<>(numThreads)));
  this.processors.forEach((processor) -> scheduleQueueReader(executorService,processor.getQueueReader()));
}
Program: 166600
Project: 166600
Buggy source:
public IncomingRequestProcessor(final Config schemaMappingConfig,@Nullable final KafkaFlushingPool kafkaFlushingPool,@Nullable final HdfsFlushingPool hdfsFlushingPool,final Schema schema){
  this.queue=new LinkedBlockingQueue<>();
  this.kafkaFlushingPool=kafkaFlushingPool;
  this.hdfsFlushingPool=hdfsFlushingPool;
  this.maker=new GenericRecordMaker(Objects.requireNonNull(schema),Objects.requireNonNull(schemaMappingConfig));
}

Fixed version (ground truth):
public IncomingRequestProcessor(final Config config,@Nullable final KafkaFlushingPool kafkaFlushingPool,@Nullable final HdfsFlushingPool hdfsFlushingPool,final Schema schema){
  this.queue=new LinkedBlockingQueue<>();
  this.kafkaFlushingPool=kafkaFlushingPool;
  this.hdfsFlushingPool=hdfsFlushingPool;
  final Config schemaMappingConfig=schemaMappingConfigFromConfig(Objects.requireNonNull(config));
  this.maker=new GenericRecordMaker(Objects.requireNonNull(schema),schemaMappingConfig,config);
}
Program: 166601
Project: 166601
Buggy source:
@Override public CharSequence getPageTitle(int position){
}

Fixed version (ground truth):
@Override public CharSequence getPageTitle(int position){
  if (position < data.getCount()) {
    Object item=data.getItem(position);
    if (item instanceof BlobDescriptor) {
      return ((BlobDescriptor)item).key;
    }
    if (item instanceof Slob.Blob) {
      return ((Blob)item).key;
    }
  }
  return "String_Node_Str";
}
Program: 166603
Project: 166603
Buggy source:
private synchronized Log getLogger(String name){
  ChronicleLogger logger=loggers.get(name);
  if (logger == null) {
    loggers.put(name,logger=new ChronicleLogger(manager.createWriter(name),name,ChronicleLogLevel.fromStringLevel(manager.cfg().getString(name,ChronicleLogConfig.KEY_LEVEL))));
  }
  return logger;
}

Fixed version (ground truth):
private synchronized Log getLogger(String name) throws IOException {
  ChronicleLogger logger=loggers.get(name);
  if (logger == null) {
    loggers.put(name,logger=new ChronicleLogger(manager.createWriter(name),name,ChronicleLogLevel.fromStringLevel(manager.cfg().getString(name,ChronicleLogConfig.KEY_LEVEL))));
  }
  return logger;
}