nus-yam/ex-repair huggingface dataset:
Program: 5253
Project: 5253
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5254
Project: 5254
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5255
Project: 5255
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5256
Project: 5256
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5257
Project: 5257
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5258
Project: 5258
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5259
Project: 5259
Buggy source:
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=new HashMap<>();
  for (  Map.Entry<ImmutableBytesWritable,ImmutableBytesWritable> value : descriptor.getValues().entrySet()) {
    properties.put(org.apache.hadoop.hbase.util.Bytes.toString(value.getKey().get()),org.apache.hadoop.hbase.util.Bytes.toString(value.getValue().get()));
  }
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}

Fixed version (ground truth):
public static TableDescriptor getTableDescriptor(HTableDescriptor descriptor){
  Set<ColumnFamilyDescriptor> families=new HashSet<>();
  for (  HColumnDescriptor family : descriptor.getColumnFamilies()) {
    families.add(getColumnFamilyDescriptor(family));
  }
  Set<CoprocessorDescriptor> coprocessors=new HashSet<>();
  coprocessors.addAll(CoprocessorUtil.getCoprocessors(descriptor).values());
  Map<String,String> properties=CoprocessorUtil.getNonCoprocessorProperties(descriptor);
  return new TableDescriptor(descriptor.getTableName().getNamespaceAsString(),descriptor.getTableName().getQualifierAsString(),families,coprocessors,properties);
}
Program: 5260
Project: 5260
Buggy source:
@Inject public HBaseQueueClientFactory(CConfiguration cConf,Configuration hConf,HBaseTableUtil hBaseTableUtil,QueueAdmin queueAdmin,TransactionExecutorFactory txExecutorFactory){
  this.cConf=cConf;
  this.hConf=hConf;
  this.queueAdmin=(HBaseQueueAdmin)queueAdmin;
  this.queueUtil=new HBaseQueueUtilFactory().get();
  this.hBaseTableUtil=hBaseTableUtil;
  this.txExecutorFactory=txExecutorFactory;
}

Fixed version (ground truth):
@Inject public HBaseQueueClientFactory(CConfiguration cConf,Configuration hConf,HBaseTableUtil hBaseTableUtil,QueueAdmin queueAdmin,TransactionExecutorFactory txExecutorFactory){
  this.cConf=cConf;
  this.hConf=hConf;
  this.queueAdmin=(HBaseQueueAdmin)queueAdmin;
  this.queueUtil=new HBaseQueueUtilFactory().get();
  this.hBaseTableUtil=hBaseTableUtil;
  this.txExecutorFactory=txExecutorFactory;
  this.txMaxLifeTimeInMillis=TimeUnit.SECONDS.toMillis(cConf.getLong(Constants.Tephra.CFG_TX_MAX_LIFETIME,Constants.Tephra.DEFAULT_TX_MAX_LIFETIME));
}
Program: 5261
Project: 5261
Buggy source:
private HBaseQueueProducer createProducer(HTable hTable,QueueName queueName,QueueMetrics queueMetrics,HBaseQueueStrategy queueStrategy,Iterable<? extends ConsumerGroupConfig> groupConfigs) throws IOException {
  return new HBaseQueueProducer(hTable,queueName,queueMetrics,queueStrategy,groupConfigs);
}

Fixed version (ground truth):
private HBaseQueueProducer createProducer(HTable hTable,QueueName queueName,QueueMetrics queueMetrics,HBaseQueueStrategy queueStrategy,Iterable<? extends ConsumerGroupConfig> groupConfigs) throws IOException {
  return new HBaseQueueProducer(hTable,queueName,queueMetrics,queueStrategy,groupConfigs,txMaxLifeTimeInMillis);
}
Program: 5262
Project: 5262
Buggy source:
public HBaseQueueProducer(HTable hTable,QueueName queueName,QueueMetrics queueMetrics,HBaseQueueStrategy queueStrategy,Iterable<? extends ConsumerGroupConfig> consumerGroupConfigs){
  super(queueMetrics,queueName);
  this.queueStrategy=queueStrategy;
  this.consumerGroupConfigs=ImmutableList.copyOf(Iterables.filter(consumerGroupConfigs,new Predicate<ConsumerGroupConfig>(){
    private final Set<Long> seenGroups=Sets.newHashSet();
    @Override public boolean apply(    ConsumerGroupConfig config){
      return seenGroups.add(config.getGroupId());
    }
  }
));
  this.queueRowPrefix=QueueEntryRow.getQueueRowPrefix(queueName);
  this.rollbackKeys=Lists.newArrayList();
  this.hTable=hTable;
}

Fixed version (ground truth):
public HBaseQueueProducer(HTable hTable,QueueName queueName,QueueMetrics queueMetrics,HBaseQueueStrategy queueStrategy,Iterable<? extends ConsumerGroupConfig> consumerGroupConfigs,long txMaxLifeTimeInMillis){
  super(queueMetrics,queueName);
  this.queueStrategy=queueStrategy;
  this.consumerGroupConfigs=ImmutableList.copyOf(Iterables.filter(consumerGroupConfigs,new Predicate<ConsumerGroupConfig>(){
    private final Set<Long> seenGroups=Sets.newHashSet();
    @Override public boolean apply(    ConsumerGroupConfig config){
      return seenGroups.add(config.getGroupId());
    }
  }
));
  this.queueRowPrefix=QueueEntryRow.getQueueRowPrefix(queueName);
  this.rollbackKeys=Lists.newArrayList();
  this.hTable=hTable;
  this.txMaxLifeTimeInMillis=txMaxLifeTimeInMillis;
}
Program: 5263
Project: 5263
Buggy source:
/** 
 * Persist queue entries into HBase.
 */
protected int persist(Iterable<QueueEntry> entries,Transaction transaction) throws IOException {
  int count=0;
  List<Put> puts=Lists.newArrayList();
  int bytes=0;
  List<byte[]> rowKeys=Lists.newArrayList();
  long writePointer=transaction.getWritePointer();
  for (  QueueEntry entry : entries) {
    rowKeys.clear();
    queueStrategy.getRowKeys(consumerGroupConfigs,entry,queueRowPrefix,writePointer,count,rowKeys);
    rollbackKeys.addAll(rowKeys);
    byte[] metaData=QueueEntry.serializeHashKeys(entry.getHashKeys());
    for (    byte[] rowKey : rowKeys) {
      Put put=new Put(rowKey);
      put.add(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.DATA_COLUMN,entry.getData());
      put.add(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.META_COLUMN,metaData);
      puts.add(put);
      bytes+=entry.getData().length;
    }
    count++;
  }
  hTable.put(puts);
  hTable.flushCommits();
  return bytes;
}

Fixed version (ground truth):
/** 
 * Persist queue entries into HBase.
 */
protected int persist(Iterable<QueueEntry> entries,Transaction transaction) throws IOException {
  int count=0;
  List<Put> puts=Lists.newArrayList();
  int bytes=0;
  List<byte[]> rowKeys=Lists.newArrayList();
  long writePointer=transaction.getWritePointer();
  ensureValidTxLifetime(writePointer);
  for (  QueueEntry entry : entries) {
    rowKeys.clear();
    queueStrategy.getRowKeys(consumerGroupConfigs,entry,queueRowPrefix,writePointer,count,rowKeys);
    rollbackKeys.addAll(rowKeys);
    byte[] metaData=QueueEntry.serializeHashKeys(entry.getHashKeys());
    for (    byte[] rowKey : rowKeys) {
      Put put=new Put(rowKey);
      put.add(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.DATA_COLUMN,entry.getData());
      put.add(QueueEntryRow.COLUMN_FAMILY,QueueEntryRow.META_COLUMN,metaData);
      puts.add(put);
      bytes+=entry.getData().length;
    }
    count++;
  }
  hTable.put(puts);
  hTable.flushCommits();
  return bytes;
}
Program: 5264
Project: 5264
Buggy source:
@VisibleForTesting CoreMessagingService(CConfiguration cConf,TableFactory tableFactory,TimeProvider timeProvider,MetricsCollectionService metricsCollectionService){
  this.cConf=cConf;
  this.tableFactory=tableFactory;
  this.topicCache=createTopicCache();
  this.messageTableWriterCache=createTableWriterCache(true,cConf);
  this.payloadTableWriterCache=createTableWriterCache(false,cConf);
  this.timeProvider=timeProvider;
  this.metricsCollectionService=metricsCollectionService;
}

Fixed version (ground truth):
@VisibleForTesting CoreMessagingService(CConfiguration cConf,TableFactory tableFactory,TimeProvider timeProvider,MetricsCollectionService metricsCollectionService){
  this.cConf=cConf;
  this.tableFactory=tableFactory;
  this.topicCache=createTopicCache();
  this.messageTableWriterCache=createTableWriterCache(true,cConf);
  this.payloadTableWriterCache=createTableWriterCache(false,cConf);
  this.timeProvider=timeProvider;
  this.metricsCollectionService=metricsCollectionService;
  this.txMaxLifeTimeInMillis=TimeUnit.SECONDS.toMillis(cConf.getLong(Constants.Tephra.CFG_TX_MAX_LIFETIME,Constants.Tephra.DEFAULT_TX_MAX_LIFETIME));
}
Program: 5265
Project: 5265
Buggy source:
@Nullable @Override public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException {
  try {
    TopicMetadata metadata=topicCache.get(request.getTopicId());
    return messageTableWriterCache.get(request.getTopicId()).persist(request,metadata);
  }
 catch (  ExecutionException e) {
    Throwable cause=Objects.firstNonNull(e.getCause(),e);
    Throwables.propagateIfPossible(cause,TopicNotFoundException.class,IOException.class);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Nullable @Override public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException {
  try {
    TopicMetadata metadata=topicCache.get(request.getTopicId());
    if (request.isTransactional()) {
      ensureValidTxLifetime(request.getTransactionWritePointer());
    }
    return messageTableWriterCache.get(request.getTopicId()).persist(request,metadata);
  }
 catch (  ExecutionException e) {
    Throwable cause=Objects.firstNonNull(e.getCause(),e);
    Throwables.propagateIfPossible(cause,TopicNotFoundException.class,IOException.class);
    throw Throwables.propagate(e);
  }
}
Program: 5266
Project: 5266
Buggy source:
@BeforeClass public static void init() throws IOException {
  cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMP_FOLDER.newFolder().getAbsolutePath());
  cConf.setInt(Constants.MessagingSystem.HTTP_SERVER_CONSUME_CHUNK_SIZE,128);
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new MessagingServerRuntimeModule().getInMemoryModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).toInstance(new NoOpMetricsCollectionService());
    }
  }
);
  httpService=injector.getInstance(MessagingHttpService.class);
  httpService.startAndWait();
  client=new ClientMessagingService(injector.getInstance(DiscoveryServiceClient.class));
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TEMP_FOLDER.newFolder().getAbsolutePath());
  cConf.setInt(Constants.MessagingSystem.HTTP_SERVER_CONSUME_CHUNK_SIZE,128);
  cConf.setLong(Constants.Tephra.CFG_TX_MAX_LIFETIME,10000000000L);
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new MessagingServerRuntimeModule().getInMemoryModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetricsCollectionService.class).toInstance(new NoOpMetricsCollectionService());
    }
  }
);
  httpService=injector.getInstance(MessagingHttpService.class);
  httpService.startAndWait();
  client=new ClientMessagingService(injector.getInstance(DiscoveryServiceClient.class));
}
Program: 5267
Project: 5267
Buggy source:
@Override public void flush() throws IOException {
  out.flush();
}

Fixed version (ground truth):
@Override public void flush() throws IOException {
  if (out instanceof org.apache.hadoop.fs.Syncable) {
    ((org.apache.hadoop.fs.Syncable)out).hflush();
  }
 else {
    out.flush();
  }
}
Program: 5268
Project: 5268
Buggy source:
@Override public void sync() throws IOException {
  if (out instanceof Syncable) {
    ((org.apache.hadoop.fs.Syncable)out).hsync();
  }
}

Fixed version (ground truth):
@Override public void sync() throws IOException {
  if (out instanceof org.apache.hadoop.fs.Syncable) {
    ((org.apache.hadoop.fs.Syncable)out).hsync();
  }
 else {
    out.flush();
  }
}
Program: 5269
Project: 5269
Buggy source:
private HiveConf getHiveConf(){
  HiveConf conf=new HiveConf();
  if (UserGroupInformation.isSecurityEnabled()) {
    conf.set(HIVE_METASTORE_TOKEN_KEY,HiveAuthFactory.HS2_CLIENT_TOKEN);
  }
  String whiteListAppend=conf.getVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST_APPEND);
  if (whiteListAppend != null && !whiteListAppend.trim().isEmpty()) {
    whiteListAppend=whiteListAppend + "String_Node_Str" + PARAMS_EXPLORE_MODIFIES;
  }
 else {
    whiteListAppend=PARAMS_EXPLORE_MODIFIES;
  }
  conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST_APPEND,whiteListAppend);
  conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,UserGroupInformation.AuthenticationMethod.SIMPLE.name());
  conf.unset("String_Node_Str");
  conf.unset("String_Node_Str");
  return conf;
}

Fixed version (ground truth):
private HiveConf getHiveConf(){
  HiveConf conf=new HiveConf();
  if (UserGroupInformation.isSecurityEnabled()) {
    conf.set(HIVE_METASTORE_TOKEN_KEY,HiveAuthFactory.HS2_CLIENT_TOKEN);
  }
  String whiteListAppend=conf.get(Constants.Explore.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST_APPEND);
  if (whiteListAppend != null && !whiteListAppend.trim().isEmpty()) {
    whiteListAppend=whiteListAppend + "String_Node_Str" + PARAMS_EXPLORE_MODIFIES;
  }
 else {
    whiteListAppend=PARAMS_EXPLORE_MODIFIES;
  }
  conf.set(Constants.Explore.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST_APPEND,whiteListAppend);
  conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,UserGroupInformation.AuthenticationMethod.SIMPLE.name());
  conf.unset(Constants.Explore.HIVE_SERVER2_SPNEGO_KEYTAB);
  conf.unset(Constants.Explore.HIVE_SERVER2_SPNEGO_PRINCIPAL);
  return conf;
}
Program: 5271
Project: 5271
Buggy source:
@Override public void stop(){
}

Fixed version (ground truth):
/** 
 * By default, this method is a no-op. This method should be overridden to provide actual   {@code stop} functionality.
 */
@Override public void stop(){
}
Program: 5272
Project: 5272
Buggy source:
@Override @TransactionPolicy(TransactionControl.EXPLICIT) public void destroy(){
}

Fixed version (ground truth):
/** 
 * By default, this method is a no-op. This method should be overridden to provide actual   {@code destroy}functionality.
 */
@Override @TransactionPolicy(TransactionControl.EXPLICIT) public void destroy(){
}
Program: 5273
Project: 5273
Buggy source:
/** 
 * Request to stop the running worker. This method will be invoked from a different thread than the one calling the   {@link #run()} method.
 */
void stop();

Fixed version (ground truth):
/** 
 * Stop the   {@code Worker}. This method will be invoked whenever the worker is externally stopped by CDAP. This method will be invoked from a different thread than the one calling the   {@link #run()} method.
 */
void stop();
Program: 5274
Project: 5274
Buggy source:
/** 
 * Destroy the Worker. Note that unlike most program types, this method is not called within an implicit transaction, but instead it can start its own transactions using   {@link WorkerContext#execute(TxRunnable)}.
 */
@Override @TransactionPolicy(TransactionControl.EXPLICIT) void destroy();

Fixed version (ground truth):
/** 
 * Destroy the   {@code Worker}. Note that unlike most program types, this method is not called within an implicit transaction, but instead it can start its own transactions using   {@link WorkerContext#execute(TxRunnable)}.
 */
@Override @TransactionPolicy(TransactionControl.EXPLICIT) void destroy();
Program: 5275
Project: 5275
Buggy source:
/** 
 * Configure a Worker.
 */
void configure(WorkerConfigurer configurer);

Fixed version (ground truth):
/** 
 * Configure a   {@code Worker}.
 */
void configure(WorkerConfigurer configurer);
Program: 5276
Project: 5276
Buggy source:
/** 
 * Initialize the Worker. Note that unlike most program types, this method is not called within an implicit transaction, but instead it can start its own transactions using   {@link WorkerContext#execute(TxRunnable)}. methods.
 */
@Override @TransactionPolicy(TransactionControl.EXPLICIT) void initialize(WorkerContext context) throws Exception ;

Fixed version (ground truth):
/** 
 * Initialize the   {@code Worker}. Note that unlike most program types, this method is not called within an implicit transaction, but instead it can start its own transactions using   {@link WorkerContext#execute(TxRunnable)}. methods.
 */
@Override @TransactionPolicy(TransactionControl.EXPLICIT) void initialize(WorkerContext context) throws Exception ;
Program: 5277
Project: 5277
Buggy source:
/** 
 * @param principal The principal whose KeytabURI is being looked up
 * @param cConf To lookup the configured path for the keytabs
 * @return The location of the keytab
 * @throws IOException If the principal is not a valid kerberos principal
 */
static String getKeytabURIforPrincipal(String principal,CConfiguration cConf) throws IOException {
  String confPath=cConf.getRaw(Constants.Security.KEYTAB_PATH);
  String name=new KerberosName(principal).getShortName();
  return confPath.replace(Constants.USER_NAME_SPECIFIER,name);
}

Fixed version (ground truth):
/** 
 * @param principal The principal whose KeytabURI is being looked up
 * @param cConf To lookup the configured path for the keytabs
 * @return The location of the keytab
 * @throws IOException If the principal is not a valid kerberos principal
 */
static String getKeytabURIforPrincipal(String principal,CConfiguration cConf) throws IOException {
  String confPath=cConf.getRaw(Constants.Security.KEYTAB_PATH);
  Preconditions.checkNotNull(confPath,String.format("String_Node_Str" + "String_Node_Str",Constants.Security.KEYTAB_PATH));
  String name=new KerberosName(principal).getShortName();
  return confPath.replace(Constants.USER_NAME_SPECIFIER,name);
}
Program: 5279
Project: 5279
Buggy source:
protected void setPreferences(Arguments arguments,PrintStream printStream,Map<String,String> args) throws Exception {
  String[] programIdParts=new String[0];
  if (arguments.hasArgument(type.getArgumentName().toString())) {
    programIdParts=arguments.get(type.getArgumentName().toString()).split("String_Node_Str");
  }
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.setNamespacePreferences(cliConfig.getCurrentNamespace(),args);
printSuccessMessage(printStream,type);
break;
case APP:
client.setApplicationPreferences(parseApplicationId(arguments),args);
printSuccessMessage(printStream,type);
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
client.setProgramPreferences(parseProgramId(arguments,type),args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}

Fixed version (ground truth):
protected void setPreferences(Arguments arguments,PrintStream printStream,Map<String,String> args,String[] programIdParts) throws Exception {
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.setNamespacePreferences(cliConfig.getCurrentNamespace(),args);
printSuccessMessage(printStream,type);
break;
case APP:
client.setApplicationPreferences(parseApplicationId(arguments),args);
printSuccessMessage(printStream,type);
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
client.setProgramPreferences(parseProgramId(arguments,type),args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}
Program: 5280
Project: 5280
Buggy source:
protected String determinePattern(String action){
switch (action) {
case "String_Node_Str":
    return determinePatternSetHelper();
case "String_Node_Str":
  return determinePatternLoadHelper();
}
throw new RuntimeException("String_Node_Str" + type.getShortName());
}

Fixed version (ground truth):
protected String determinePattern(String action){
switch (action) {
case "String_Node_Str":
    return determineSetPatternHelper();
case "String_Node_Str":
  return determineLoadPatternHelper();
}
throw new RuntimeException("String_Node_Str" + action);
}
Program: 5281
Project: 5281
Buggy source:
private static UserGroupInformation getUgiForDataset(Impersonator impersonator,DatasetId datasetInstanceId) throws IOException, NamespaceNotFoundException {
  UserGroupInformation ugi;
  if (NamespaceId.SYSTEM.equals(datasetInstanceId.getParent())) {
    ugi=UserGroupInformation.getCurrentUser();
  }
 else {
    ugi=impersonator.getUGI(datasetInstanceId);
  }
  LOG.debug("String_Node_Str",ugi.getUserName(),datasetInstanceId);
  return ugi;
}

Fixed version (ground truth):
private static UserGroupInformation getUgiForDataset(Impersonator impersonator,DatasetId datasetInstanceId) throws IOException {
  UserGroupInformation ugi;
  if (NamespaceId.SYSTEM.equals(datasetInstanceId.getParent())) {
    ugi=UserGroupInformation.getCurrentUser();
  }
 else {
    ugi=impersonator.getUGI(datasetInstanceId);
  }
  LOG.debug("String_Node_Str",ugi.getUserName(),datasetInstanceId);
  return ugi;
}
Program: 5282
Project: 5282
Buggy source:
private UserGroupInformation getUGI(NamespacedEntityId entityId,ImpersonatedOpType impersonatedOpType) throws IOException {
  if (!kerberosEnabled || NamespaceId.SYSTEM.equals(entityId.getNamespaceId())) {
    return UserGroupInformation.getCurrentUser();
  }
  return ugiProvider.getConfiguredUGI(new ImpersonationRequest(entityId,impersonatedOpType)).getUGI();
}

Fixed version (ground truth):
private UserGroupInformation getUGI(NamespacedEntityId entityId,ImpersonatedOpType impersonatedOpType) throws IOException {
  if (!kerberosEnabled || NamespaceId.SYSTEM.equals(entityId.getNamespaceId())) {
    return UserGroupInformation.getCurrentUser();
  }
  ImpersonationRequest impersonationRequest=new ImpersonationRequest(entityId,impersonatedOpType);
  if (!UserGroupInformation.getCurrentUser().getShortUserName().equals(masterShortUsername)) {
    LOG.trace("String_Node_Str",impersonationRequest,UserGroupInformation.getCurrentUser());
    return UserGroupInformation.getCurrentUser();
  }
  return ugiProvider.getConfiguredUGI(impersonationRequest).getUGI();
}
Program: 5283
Project: 5283
Buggy source:
@Inject @VisibleForTesting public DefaultImpersonator(CConfiguration cConf,UGIProvider ugiProvider){
  this.ugiProvider=ugiProvider;
  this.kerberosEnabled=SecurityUtil.isKerberosEnabled(cConf);
}

Fixed version (ground truth):
@Inject @VisibleForTesting public DefaultImpersonator(CConfiguration cConf,UGIProvider ugiProvider){
  this.ugiProvider=ugiProvider;
  this.kerberosEnabled=SecurityUtil.isKerberosEnabled(cConf);
  String masterPrincipal=SecurityUtil.getMasterPrincipal(cConf);
  try {
    masterShortUsername=masterPrincipal == null ? null : new KerberosName(masterPrincipal).getShortName();
  }
 catch (  IOException e) {
    Throwables.propagate(e);
  }
}
Program: 5284
Project: 5284
Buggy source:
/** 
 * Retrieve the   {@link UserGroupInformation} for the given {@link NamespaceId}
 * @param entityId Entity whose effective owner's UGI will be returned
 * @return {@link UserGroupInformation}
 * @throws IOException if there was any error fetching the {@link UserGroupInformation}
 * @throws NamespaceNotFoundException if namespaceId does not exist
 */
UserGroupInformation getUGI(NamespacedEntityId entityId) throws IOException, NamespaceNotFoundException ;

Fixed version (ground truth):
/** 
 * Retrieve the   {@link UserGroupInformation} for the given {@link NamespaceId}
 * @param entityId Entity whose effective owner's UGI will be returned
 * @return {@link UserGroupInformation}
 * @throws IOException if there was any error fetching the {@link UserGroupInformation}
 */
UserGroupInformation getUGI(NamespacedEntityId entityId) throws IOException ;
Program: 5285
Project: 5285
Buggy source:
public Transaction checkpoint(Transaction originalTx) throws TransactionNotInProgressException {
  txMetricsCollector.rate("String_Node_Str");
  Stopwatch timer=new Stopwatch().start();
  Transaction checkpointedTx=null;
  long txId=originalTx.getTransactionId();
  long newWritePointer=0;
  this.logReadLock.lock();
  try {
synchronized (this) {
      ensureAvailable();
      InProgressTx parentTx=inProgress.get(txId);
      if (parentTx == null) {
        if (invalid.contains(txId)) {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",txId));
        }
 else {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",txId));
        }
      }
      newWritePointer=getNextWritePointer();
      doCheckpoint(newWritePointer,txId);
      checkpointedTx=new Transaction(originalTx,newWritePointer,parentTx.getCheckpointWritePointers().toLongArray());
    }
    appendToLog(TransactionEdit.createCheckpoint(newWritePointer,txId));
  }
  finally {
    this.logReadLock.unlock();
  }
  txMetricsCollector.histogram("String_Node_Str",(int)timer.elapsedMillis());
  return checkpointedTx;
}

Fixed version (ground truth):
public Transaction checkpoint(Transaction originalTx) throws TransactionNotInProgressException {
  txMetricsCollector.rate("String_Node_Str");
  Stopwatch timer=new Stopwatch().start();
  Transaction checkpointedTx=null;
  long txId=originalTx.getTransactionId();
  long newWritePointer=0;
  this.logReadLock.lock();
  try {
synchronized (this) {
      ensureAvailable();
      InProgressTx parentTx=inProgress.get(txId);
      if (parentTx == null) {
        if (invalidTxList.contains(txId)) {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",txId));
        }
 else {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",txId));
        }
      }
      newWritePointer=getNextWritePointer();
      doCheckpoint(newWritePointer,txId);
      checkpointedTx=new Transaction(originalTx,newWritePointer,parentTx.getCheckpointWritePointers().toLongArray());
    }
    appendToLog(TransactionEdit.createCheckpoint(newWritePointer,txId));
  }
  finally {
    this.logReadLock.unlock();
  }
  txMetricsCollector.histogram("String_Node_Str",(int)timer.elapsedMillis());
  return checkpointedTx;
}
Program: 5286
Project: 5286
Buggy source:
private void cleanupTimedOutTransactions(){
  List<TransactionEdit> invalidEdits=null;
  logReadLock.lock();
  try {
synchronized (this) {
      if (!isRunning()) {
        return;
      }
      long currentTime=System.currentTimeMillis();
      Map<Long,InProgressType> timedOut=Maps.newHashMap();
      for (      Map.Entry<Long,InProgressTx> tx : inProgress.entrySet()) {
        long expiration=tx.getValue().getExpiration();
        if (expiration >= 0L && currentTime > expiration) {
          timedOut.put(tx.getKey(),tx.getValue().getType());
          LOG.info("String_Node_Str",tx.getKey());
        }
 else         if (expiration < 0) {
          LOG.warn("String_Node_Str" + "String_Node_Str",tx.getKey(),expiration);
          timedOut.put(tx.getKey(),InProgressType.LONG);
        }
      }
      if (!timedOut.isEmpty()) {
        invalidEdits=Lists.newArrayListWithCapacity(timedOut.size());
        invalid.addAll(timedOut.keySet());
        for (        Map.Entry<Long,InProgressType> tx : timedOut.entrySet()) {
          inProgress.remove(tx.getKey());
          if (!InProgressType.CHECKPOINT.equals(tx.getValue())) {
            committingChangeSets.remove(tx.getKey());
            invalidEdits.add(TransactionEdit.createInvalid(tx.getKey()));
          }
        }
        Collections.sort(invalid);
        invalidArray=invalid.toLongArray();
        LOG.info("String_Node_Str",timedOut.size());
      }
    }
    if (invalidEdits != null) {
      appendToLog(invalidEdits);
    }
  }
  finally {
    this.logReadLock.unlock();
  }
}

Fixed version (ground truth):
private void cleanupTimedOutTransactions(){
  List<TransactionEdit> invalidEdits=null;
  logReadLock.lock();
  try {
synchronized (this) {
      if (!isRunning()) {
        return;
      }
      long currentTime=System.currentTimeMillis();
      Map<Long,InProgressType> timedOut=Maps.newHashMap();
      for (      Map.Entry<Long,InProgressTx> tx : inProgress.entrySet()) {
        long expiration=tx.getValue().getExpiration();
        if (expiration >= 0L && currentTime > expiration) {
          timedOut.put(tx.getKey(),tx.getValue().getType());
          LOG.info("String_Node_Str",tx.getKey());
        }
 else         if (expiration < 0) {
          LOG.warn("String_Node_Str" + "String_Node_Str",tx.getKey(),expiration);
          timedOut.put(tx.getKey(),InProgressType.LONG);
        }
      }
      if (!timedOut.isEmpty()) {
        invalidEdits=Lists.newArrayListWithCapacity(timedOut.size());
        invalidTxList.addAll(timedOut.keySet());
        for (        Map.Entry<Long,InProgressType> tx : timedOut.entrySet()) {
          inProgress.remove(tx.getKey());
          if (!InProgressType.CHECKPOINT.equals(tx.getValue())) {
            committingChangeSets.remove(tx.getKey());
            invalidEdits.add(TransactionEdit.createInvalid(tx.getKey()));
          }
        }
        LOG.info("String_Node_Str",timedOut.size());
      }
    }
    if (invalidEdits != null) {
      appendToLog(invalidEdits);
    }
  }
  finally {
    this.logReadLock.unlock();
  }
}
Program: 5287
Project: 5287
Buggy source:
public boolean commit(Transaction tx) throws TransactionNotInProgressException {
  txMetricsCollector.rate("String_Node_Str");
  Stopwatch timer=new Stopwatch().start();
  Set<ChangeId> changeSet=null;
  boolean addToCommitted=true;
  long commitPointer;
  this.logReadLock.lock();
  try {
synchronized (this) {
      ensureAvailable();
      commitPointer=lastWritePointer + 1;
      if (inProgress.get(tx.getTransactionId()) == null) {
        if (invalid.contains(tx.getTransactionId())) {
          throw new TransactionNotInProgressException(String.format("String_Node_Str" + "String_Node_Str",tx.getTransactionId()));
        }
 else {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",tx.getTransactionId()));
        }
      }
      changeSet=committingChangeSets.remove(tx.getTransactionId());
      if (changeSet != null) {
        if (hasConflicts(tx,changeSet)) {
          return false;
        }
      }
 else {
        addToCommitted=false;
      }
      doCommit(tx.getTransactionId(),tx.getWritePointer(),changeSet,commitPointer,addToCommitted);
    }
    appendToLog(TransactionEdit.createCommitted(tx.getTransactionId(),changeSet,commitPointer,addToCommitted));
  }
  finally {
    this.logReadLock.unlock();
  }
  txMetricsCollector.histogram("String_Node_Str",(int)timer.elapsedMillis());
  return true;
}

Fixed version (ground truth):
public boolean commit(Transaction tx) throws TransactionNotInProgressException {
  txMetricsCollector.rate("String_Node_Str");
  Stopwatch timer=new Stopwatch().start();
  Set<ChangeId> changeSet=null;
  boolean addToCommitted=true;
  long commitPointer;
  this.logReadLock.lock();
  try {
synchronized (this) {
      ensureAvailable();
      commitPointer=lastWritePointer + 1;
      if (inProgress.get(tx.getTransactionId()) == null) {
        if (invalidTxList.contains(tx.getTransactionId())) {
          throw new TransactionNotInProgressException(String.format("String_Node_Str" + "String_Node_Str",tx.getTransactionId()));
        }
 else {
          throw new TransactionNotInProgressException(String.format("String_Node_Str",tx.getTransactionId()));
        }
      }
      changeSet=committingChangeSets.remove(tx.getTransactionId());
      if (changeSet != null) {
        if (hasConflicts(tx,changeSet)) {
          return false;
        }
      }
 else {
        addToCommitted=false;
      }
      doCommit(tx.getTransactionId(),tx.getWritePointer(),changeSet,commitPointer,addToCommitted);
    }
    appendToLog(TransactionEdit.createCommitted(tx.getTransactionId(),changeSet,commitPointer,addToCommitted));
  }
  finally {
    this.logReadLock.unlock();
  }
  txMetricsCollector.histogram("String_Node_Str",(int)timer.elapsedMillis());
  return true;
}
Program: 5288
Project: 5288
Buggy source:
public int getExcludedListSize(){
  return invalid.size() + inProgress.size();
}

Fixed version (ground truth):
public int getExcludedListSize(){
  return getInvalidSize() + inProgress.size();
}
Program: 5289
Project: 5289
Buggy source:
private boolean doInvalidate(long writePointer){
  Set<ChangeId> previousChangeSet=committingChangeSets.remove(writePointer);
  InProgressTx previous=inProgress.remove(writePointer);
  if (previous != null || previousChangeSet != null) {
    invalid.add(writePointer);
    if (previous == null) {
      LOG.debug("String_Node_Str",writePointer);
    }
 else {
      LongArrayList childWritePointers=previous.getCheckpointWritePointers();
      if (!childWritePointers.isEmpty()) {
        invalid.addAll(childWritePointers);
        inProgress.keySet().removeAll(childWritePointers);
      }
    }
    LOG.info("String_Node_Str",writePointer);
    Collections.sort(invalid);
    invalidArray=invalid.toLongArray();
    if (previous != null && !previous.isLongRunning()) {
      moveReadPointerIfNeeded(writePointer);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean doInvalidate(long writePointer){
  Set<ChangeId> previousChangeSet=committingChangeSets.remove(writePointer);
  InProgressTx previous=inProgress.remove(writePointer);
  if (previous != null || previousChangeSet != null) {
    invalidTxList.add(writePointer);
    if (previous == null) {
      LOG.debug("String_Node_Str",writePointer);
    }
 else {
      LongArrayList childWritePointers=previous.getCheckpointWritePointers();
      if (!childWritePointers.isEmpty()) {
        invalidTxList.addAll(childWritePointers);
        inProgress.keySet().removeAll(childWritePointers);
      }
    }
    LOG.info("String_Node_Str",writePointer);
    if (previous != null && !previous.isLongRunning()) {
      moveReadPointerIfNeeded(writePointer);
    }
    return true;
  }
  return false;
}
Program: 5290
Project: 5290
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(defaultLongTimeout,longTimeoutTolerance,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(invalidTxList.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();
  invalidTxList.addAll(snapshot.getInvalid());
  inProgress.putAll(txnBackwardsCompatCheck(defaultLongTimeout,longTimeoutTolerance,snapshot.getInProgress()));
  committingChangeSets.putAll(snapshot.getCommittingChangeSets());
  committedChangeSets.putAll(snapshot.getCommittedChangeSets());
}
Program: 5291
Project: 5291
Buggy source:
private void startMetricsThread(){
  LOG.info("String_Node_Str" + METRICS_POLL_INTERVAL);
  this.metricsThread=new DaemonThreadExecutor("String_Node_Str"){
    @Override public void doRun(){
      txMetricsCollector.gauge("String_Node_Str",committingChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",committedChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",inProgress.size());
      txMetricsCollector.gauge("String_Node_Str",invalidArray.length);
    }
    @Override protected void onShutdown(){
      txMetricsCollector.gauge("String_Node_Str",committingChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",committedChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",inProgress.size());
      txMetricsCollector.gauge("String_Node_Str",invalidArray.length);
    }
    @Override public long getSleepMillis(){
      return METRICS_POLL_INTERVAL;
    }
  }
;
  metricsThread.start();
}

Fixed version (ground truth):
private void startMetricsThread(){
  LOG.info("String_Node_Str" + METRICS_POLL_INTERVAL);
  this.metricsThread=new DaemonThreadExecutor("String_Node_Str"){
    @Override public void doRun(){
      txMetricsCollector.gauge("String_Node_Str",committingChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",committedChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",inProgress.size());
      txMetricsCollector.gauge("String_Node_Str",getInvalidSize());
    }
    @Override protected void onShutdown(){
      txMetricsCollector.gauge("String_Node_Str",committingChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",committedChangeSets.size());
      txMetricsCollector.gauge("String_Node_Str",inProgress.size());
      txMetricsCollector.gauge("String_Node_Str",getInvalidSize());
    }
    @Override public long getSleepMillis(){
      return METRICS_POLL_INTERVAL;
    }
  }
;
  metricsThread.start();
}