nus-yam/ex-repair huggingface dataset:
Program: 49355
Project: 49355
Buggy source:
public boolean containsKey(Object k){
  final NodeEngine nodeEngine=getNodeEngine();
  Data key=nodeEngine.toData(k);
  return containsKeyInternal(key);
}

Fixed version (ground truth):
public boolean containsKey(Object k){
  final NodeEngine nodeEngine=getNodeEngine();
  Data key=getService().toData(k);
  return containsKeyInternal(key);
}
Program: 49356
Project: 49356
Buggy source:
protected boolean containsKeyInternal(Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  ContainsKeyOperation containsKeyOperation=new ContainsKeyOperation(name,key);
  containsKeyOperation.setServiceName(SERVICE_NAME);
  try {
    Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,containsKeyOperation,partitionId).build();
    Future f=invocation.invoke();
    return (Boolean)nodeEngine.toObject(f.get());
  }
 catch (  Throwable t) {
    throw new RuntimeException(t);
  }
}

Fixed version (ground truth):
protected boolean containsKeyInternal(Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  ContainsKeyOperation containsKeyOperation=new ContainsKeyOperation(name,key);
  containsKeyOperation.setServiceName(SERVICE_NAME);
  try {
    Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,containsKeyOperation,partitionId).build();
    Future f=invocation.invoke();
    return (Boolean)getService().toObject(f.get());
  }
 catch (  Throwable t) {
    throw new RuntimeException(t);
  }
}
Program: 49357
Project: 49357
Buggy source:
protected Collection<Data> valuesInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapValuesOperation mapValuesOperation=new MapValuesOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapValuesOperation);
    List<Data> values=new ArrayList<Data>();
    for (    Object result : results.values()) {
      values.addAll(((MapValueCollection)nodeEngine.toObject(result)).getValues());
    }
    return values;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected Collection<Data> valuesInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapValuesOperation mapValuesOperation=new MapValuesOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapValuesOperation);
    List<Data> values=new ArrayList<Data>();
    for (    Object result : results.values()) {
      values.addAll(((MapValueCollection)getService().toObject(result)).getValues());
    }
    return values;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49358
Project: 49358
Buggy source:
public boolean containsValueInternal(Data dataValue){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    ContainsValueOperation containsValueOperation=new ContainsValueOperation(name,dataValue);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,containsValueOperation);
    for (    Object result : results.values()) {
      Boolean contains=(Boolean)nodeEngine.toObject(result);
      if (contains)       return true;
    }
    return false;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public boolean containsValueInternal(Data dataValue){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    ContainsValueOperation containsValueOperation=new ContainsValueOperation(name,dataValue);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,containsValueOperation);
    for (    Object result : results.values()) {
      Boolean contains=(Boolean)getService().toObject(result);
      if (contains)       return true;
    }
    return false;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49359
Project: 49359
Buggy source:
protected void putAllObjectInternal(final Map<? extends Object,? extends Object> m){
  final NodeEngine nodeEngine=getNodeEngine();
  for (  Entry<? extends Object,? extends Object> entry : m.entrySet()) {
    putInternal(nodeEngine.toData(entry.getKey()),nodeEngine.toData(entry.getValue()),-1,null);
  }
}

Fixed version (ground truth):
protected void putAllObjectInternal(final Map<? extends Object,? extends Object> m){
  final NodeEngine nodeEngine=getNodeEngine();
  for (  Entry<? extends Object,? extends Object> entry : m.entrySet()) {
    putInternal(getService().toData(entry.getKey()),getService().toData(entry.getValue()),-1,null);
  }
}
Program: 49360
Project: 49360
Buggy source:
public boolean isEmpty(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapIsEmptyOperation mapIsEmptyOperation=new MapIsEmptyOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapIsEmptyOperation);
    for (    Object result : results.values()) {
      if (!(Boolean)nodeEngine.toObject(result))       return false;
    }
    return true;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public boolean isEmpty(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapIsEmptyOperation mapIsEmptyOperation=new MapIsEmptyOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapIsEmptyOperation);
    for (    Object result : results.values()) {
      if (!(Boolean)getService().toObject(result))       return false;
    }
    return true;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49361
Project: 49361
Buggy source:
protected Data getInternal(Data key){
  final MapService mapService=getService();
  final boolean nearCacheEnabled=mapService.getMapContainer(name).isNearCacheEnabled();
  if (nearCacheEnabled) {
    Data cachedData=mapService.getFromNearCache(name,key);
    if (cachedData != null)     return cachedData;
  }
  GetOperation operation=new GetOperation(name,key);
  Data result=(Data)invokeOperation(key,operation);
  if (nearCacheEnabled) {
    final NodeEngine nodeEngine=getNodeEngine();
    int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
    if (nodeEngine.getPartitionService().getPartitionOwner(partitionId).equals(nodeEngine.getClusterService().getThisAddress())) {
      mapService.putNearCache(name,key,result);
    }
  }
  return result;
}

Fixed version (ground truth):
protected Data getInternal(Data key){
  final MapService mapService=getService();
  final boolean nearCacheEnabled=mapService.getMapContainer(name).isNearCacheEnabled();
  if (nearCacheEnabled) {
    Data cachedData=mapService.getFromNearCache(name,key);
    if (cachedData != null) {
      return cachedData;
    }
  }
  GetOperation operation=new GetOperation(name,key);
  Data result=(Data)invokeOperation(key,operation);
  if (nearCacheEnabled) {
    final NodeEngine nodeEngine=getNodeEngine();
    int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
    if (nodeEngine.getPartitionService().getPartitionOwner(partitionId).equals(nodeEngine.getClusterService().getThisAddress())) {
      mapService.putNearCache(name,key,result);
    }
  }
  return result;
}
Program: 49362
Project: 49362
Buggy source:
protected Set<Entry<Data,Data>> entrySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapEntrySetOperation mapEntrySetOperation=new MapEntrySetOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapEntrySetOperation);
    Set<Entry<Data,Data>> entrySet=new HashSet<Entry<Data,Data>>();
    for (    Object result : results.values()) {
      Set entries=((MapEntrySet)nodeEngine.toObject(result)).getEntrySet();
      if (entries != null)       entrySet.addAll(entries);
    }
    return entrySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected Set<Entry<Data,Data>> entrySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapEntrySetOperation mapEntrySetOperation=new MapEntrySetOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapEntrySetOperation);
    Set<Entry<Data,Data>> entrySet=new HashSet<Entry<Data,Data>>();
    for (    Object result : results.values()) {
      Set entries=((MapEntrySet)getService().toObject(result)).getEntrySet();
      if (entries != null)       entrySet.addAll(entries);
    }
    return entrySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49363
Project: 49363
Buggy source:
public int size(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapSizeOperation mapSizeOperation=new MapSizeOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapSizeOperation);
    int total=0;
    for (    Object result : results.values()) {
      Integer size=(Integer)nodeEngine.toObject(result);
      total+=size;
    }
    return total;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public int size(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapSizeOperation mapSizeOperation=new MapSizeOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapSizeOperation);
    int total=0;
    for (    Object result : results.values()) {
      Integer size=(Integer)getService().toObject(result);
      total+=size;
    }
    return total;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49364
Project: 49364
Buggy source:
protected Map<Object,Object> getAllObjectInternal(final Set<Data> keys){
  final NodeEngine nodeEngine=getNodeEngine();
  Map<Object,Object> res=new HashMap(keys.size());
  for (  Data key : keys) {
    res.put(nodeEngine.toObject(key),nodeEngine.toObject(getInternal(key)));
  }
  return res;
}

Fixed version (ground truth):
protected Map<Object,Object> getAllObjectInternal(final Set<Data> keys){
  final NodeEngine nodeEngine=getNodeEngine();
  Map<Object,Object> res=new HashMap(keys.size());
  for (  Data key : keys) {
    res.put(getService().toObject(key),getService().toObject(getInternal(key)));
  }
  return res;
}
Program: 49365
Project: 49365
Buggy source:
protected Set<Data> keySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapKeySetOperation mapKeySetOperation=new MapKeySetOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapKeySetOperation);
    Set<Data> keySet=new HashSet<Data>();
    for (    Object result : results.values()) {
      Set keys=((MapKeySet)nodeEngine.toObject(result)).getKeySet();
      keySet.addAll(keys);
    }
    return keySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected Set<Data> keySetInternal(){
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    MapKeySetOperation mapKeySetOperation=new MapKeySetOperation(name);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,mapKeySetOperation);
    Set<Data> keySet=new HashSet<Data>();
    for (    Object result : results.values()) {
      Set keys=((MapKeySet)getService().toObject(result)).getKeySet();
      keySet.addAll(keys);
    }
    return keySet;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 49366
Project: 49366
Buggy source:
protected EntryView getEntryViewInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  GetEntryViewOperation getEntryViewOperation=new GetEntryViewOperation(name,key);
  getEntryViewOperation.setServiceName(SERVICE_NAME);
  try {
    Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,getEntryViewOperation,partitionId).build();
    Future f=invocation.invoke();
    Object o=nodeEngine.toObject(f.get());
    return (EntryView)o;
  }
 catch (  Throwable t) {
    throw new RuntimeException(t);
  }
}

Fixed version (ground truth):
protected EntryView getEntryViewInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  GetEntryViewOperation getEntryViewOperation=new GetEntryViewOperation(name,key);
  getEntryViewOperation.setServiceName(SERVICE_NAME);
  try {
    Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,getEntryViewOperation,partitionId).build();
    Future f=invocation.invoke();
    Object o=getService().toObject(f.get());
    return (EntryView)o;
  }
 catch (  Throwable t) {
    throw new RuntimeException(t);
  }
}
Program: 49367
Project: 49367
Buggy source:
protected void readInternal(final ObjectDataInput in) throws IOException {
  super.readInternal(in);
  int len=in.readInt();
  if (len > 0) {
    LockStoreImpl ls=new LockStoreImpl();
    ls.readData(in);
    locks.add(ls);
  }
}

Fixed version (ground truth):
protected void readInternal(final ObjectDataInput in) throws IOException {
  super.readInternal(in);
  int len=in.readInt();
  if (len > 0) {
    for (int i=0; i < len; i++) {
      LockStoreImpl ls=new LockStoreImpl();
      ls.readData(in);
      locks.add(ls);
    }
  }
}
Program: 49368
Project: 49368
Buggy source:
public Operation prepareMigrationOperation(MigrationServiceEvent event){
  Map<String,QueueContainer> migrationData=new HashMap<String,QueueContainer>();
  for (  Entry<String,QueueContainer> entry : containerMap.entrySet()) {
    String name=entry.getKey();
    QueueContainer container=entry.getValue();
    if (container.getPartitionId() == event.getPartitionId() && container.getConfig().getTotalBackupCount() >= event.getReplicaIndex()) {
      migrationData.put(name,container);
    }
  }
  return new QueueMigrationOperation(migrationData,event.getPartitionId(),event.getReplicaIndex());
}

Fixed version (ground truth):
public Operation prepareMigrationOperation(MigrationServiceEvent event){
  Map<String,QueueContainer> migrationData=new HashMap<String,QueueContainer>();
  for (  Entry<String,QueueContainer> entry : containerMap.entrySet()) {
    String name=entry.getKey();
    QueueContainer container=entry.getValue();
    if (container.getPartitionId() == event.getPartitionId() && container.getConfig().getTotalBackupCount() >= event.getReplicaIndex()) {
      migrationData.put(name,container);
    }
  }
  return migrationData.isEmpty() ? null : new QueueMigrationOperation(migrationData,event.getPartitionId(),event.getReplicaIndex());
}
Program: 49369
Project: 49369
Buggy source:
public void run(){
  final ConcurrentMap<K,ScheduledEntry<K,V>> entries=scheduledEntries.remove(second);
  if (entries == null || entries.isEmpty())   return;
  for (  K key : entries.keySet()) {
    secondsOfKeys.remove(key);
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,entries.values());
}

Fixed version (ground truth):
public void run(){
  final ConcurrentMap<K,ScheduledEntry<K,V>> entries=scheduledEntries.remove(second);
  if (entries == null || entries.isEmpty())   return;
  Set<ScheduledEntry<K,V>> values=new HashSet<ScheduledEntry<K,V>>(entries.size());
  for (  K key : entries.keySet()) {
    Integer removed=secondsOfKeys.remove(key);
    if (removed != null) {
      values.add(entries.get(key));
    }
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,values);
}
Program: 49370
Project: 49370
Buggy source:
public <T>T executeTransaction(TransactionalTask<T> task) throws TransactionException {
  return null;
}

Fixed version (ground truth):
public <T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException {
  return null;
}
Program: 49371
Project: 49371
Buggy source:
<T>T executeTransaction(TransactionalTask<T> task) throws TransactionException ;

Fixed version (ground truth):
<T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException ;
Program: 49372
Project: 49372
Buggy source:
public <T>T executeTransaction(TransactionalTask<T> task) throws TransactionException {
  return node.nodeEngine.getTransactionManagerService().executeTransaction(task);
}

Fixed version (ground truth):
public <T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException {
  return node.nodeEngine.getTransactionManagerService().executeTransaction(task,options);
}
Program: 49373
Project: 49373
Buggy source:
public <T>T executeTransaction(TransactionalTask<T> task) throws TransactionException {
  return getOriginal().executeTransaction(task);
}

Fixed version (ground truth):
public <T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException {
  return getOriginal().executeTransaction(task,options);
}
Program: 49374
Project: 49374
Buggy source:
public TransactionContextImpl(NodeEngineImpl nodeEngine){
  this.nodeEngine=nodeEngine;
  this.transaction=new TransactionImpl(this.nodeEngine);
}

Fixed version (ground truth):
public TransactionContextImpl(NodeEngineImpl nodeEngine,TransactionOptions options){
  this.nodeEngine=nodeEngine;
  this.transaction=new TransactionImpl(this.nodeEngine,options.getTimeoutMillis());
}
Program: 49375
Project: 49375
Buggy source:
void rollback() throws IllegalStateException {
  if (state == NO_TXN || state == ROLLED_BACK) {
    throw new IllegalStateException("String_Node_Str");
  }
  state=ROLLING_BACK;
  try {
    List<Future> futures=new ArrayList<Future>(partitions.size());
    for (    Integer partitionId : partitions) {
      RollbackOperation op=new RollbackOperation(txnId);
      futures.add(nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(timeoutMillis,TimeUnit.MILLISECONDS);
    }
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrow(e);
  }
 finally {
    state=ROLLED_BACK;
  }
}

Fixed version (ground truth):
void rollback() throws IllegalStateException {
  if (state == NO_TXN || state == ROLLED_BACK) {
    throw new IllegalStateException("String_Node_Str");
  }
  state=ROLLING_BACK;
  try {
    List<Future> futures=new ArrayList<Future>(partitions.size());
    for (    Integer partitionId : partitions) {
      RollbackOperation op=new RollbackOperation(txnId);
      futures.add(nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(5,TimeUnit.MINUTES);
    }
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrow(e);
  }
 finally {
    state=ROLLED_BACK;
  }
}
Program: 49376
Project: 49376
Buggy source:
void commit() throws TransactionException, IllegalStateException {
  if (state != ACTIVE) {
    throw new IllegalStateException("String_Node_Str");
  }
  checkTimeout();
  try {
    state=PREPARING;
    final List<Future> futures=new ArrayList<Future>(partitions.size());
    final OperationService operationService=nodeEngine.getOperationService();
    for (    Integer partitionId : partitions) {
      PrepareOperation op=new PrepareOperation(txnId);
      futures.add(operationService.createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(timeoutMillis,TimeUnit.MILLISECONDS);
    }
    state=PREPARED;
    futures.clear();
    state=COMMITTING;
    for (    Integer partitionId : partitions) {
      CommitOperation op=new CommitOperation(txnId);
      futures.add(operationService.createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(timeoutMillis,TimeUnit.MILLISECONDS);
    }
    state=COMMITTED;
  }
 catch (  Throwable e) {
    state=COMMIT_FAILED;
    if (e instanceof ExecutionException && e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
void commit() throws TransactionException, IllegalStateException {
  if (state != ACTIVE) {
    throw new IllegalStateException("String_Node_Str");
  }
  checkTimeout();
  try {
    state=PREPARING;
    final List<Future> futures=new ArrayList<Future>(partitions.size());
    final OperationService operationService=nodeEngine.getOperationService();
    for (    Integer partitionId : partitions) {
      PrepareOperation op=new PrepareOperation(txnId);
      futures.add(operationService.createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(timeoutMillis,TimeUnit.MILLISECONDS);
    }
    state=PREPARED;
    futures.clear();
    state=COMMITTING;
    for (    Integer partitionId : partitions) {
      CommitOperation op=new CommitOperation(txnId);
      futures.add(operationService.createInvocationBuilder(SERVICE_NAME,op,partitionId).build().invoke());
    }
    for (    Future future : futures) {
      future.get(5,TimeUnit.MINUTES);
    }
    state=COMMITTED;
  }
 catch (  Throwable e) {
    state=COMMIT_FAILED;
    if (e instanceof ExecutionException && e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 49377
Project: 49377
Buggy source:
public TransactionImpl(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
}

Fixed version (ground truth):
public TransactionImpl(NodeEngine nodeEngine,long timeoutMillis){
  this.nodeEngine=nodeEngine;
  this.timeoutMillis=timeoutMillis;
}
Program: 49378
Project: 49378
Buggy source:
<T>T executeTransaction(TransactionalTask<T> task) throws TransactionException ;

Fixed version (ground truth):
<T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException ;
Program: 49379
Project: 49379
Buggy source:
public void prepare(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    throw new TransactionException("String_Node_Str");
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.PREPARED);
    for (    TransactionalOperation op : log.getOperationRecords()) {
      op.doPrepare();
    }
    scheduler.schedule(ONE_MIN_MS * 2,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}

Fixed version (ground truth):
void prepare(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    throw new TransactionException("String_Node_Str");
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.PREPARED);
    for (    TransactionalOperation op : log.getOperationRecords()) {
      op.doPrepare();
    }
    scheduler.schedule(ONE_MIN_MS * 2,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}
Program: 49380
Project: 49380
Buggy source:
public void commit(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    throw new TransactionException("String_Node_Str");
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.COMMITTED);
    commitTransactionLog(log);
    scheduler.schedule(ONE_MIN_MS,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}

Fixed version (ground truth):
void commit(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    throw new TransactionException("String_Node_Str");
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.COMMITTED);
    commitTransactionLog(log);
    scheduler.schedule(ONE_MIN_MS,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}
Program: 49381
Project: 49381
Buggy source:
public <T>T executeTransaction(TransactionalTask<T> task) throws TransactionException {
  final TransactionContextImpl context=new TransactionContextImpl(nodeEngine);
  context.beginTransaction();
  try {
    final T value=task.execute(context);
    context.commitTransaction();
    return value;
  }
 catch (  Throwable e) {
    context.rollbackTransaction();
    if (e instanceof TransactionException) {
      throw (TransactionException)e;
    }
    if (e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    throw new TransactionException(e);
  }
}

Fixed version (ground truth):
public <T>T executeTransaction(TransactionalTask<T> task,TransactionOptions options) throws TransactionException {
  final TransactionContextImpl context=new TransactionContextImpl(nodeEngine,options);
  context.beginTransaction();
  try {
    final T value=task.execute(context);
    context.commitTransaction();
    return value;
  }
 catch (  Throwable e) {
    context.rollbackTransaction();
    if (e instanceof TransactionException) {
      throw (TransactionException)e;
    }
    if (e.getCause() instanceof TransactionException) {
      throw (TransactionException)e.getCause();
    }
    throw new TransactionException(e);
  }
}
Program: 49382
Project: 49382
Buggy source:
public void rollback(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    throw new TransactionException("String_Node_Str");
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.ROLLED_BACK);
    rollbackTransactionLog(log);
    scheduler.schedule(ONE_MIN_MS,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}

Fixed version (ground truth):
void rollback(String caller,String txnId,int partitionId) throws TransactionException {
  final TransactionKey key=new TransactionKey(txnId,partitionId);
  final TransactionLog log=txLogs.get(key);
  if (log == null) {
    logger.log(Level.WARNING,"String_Node_Str");
    return;
  }
  if (!log.beginProcess()) {
    throw new TransactionException("String_Node_Str");
  }
  try {
    log.setCallerUuid(caller);
    log.setState(Transaction.State.ROLLED_BACK);
    rollbackTransactionLog(log);
    scheduler.schedule(ONE_MIN_MS,key,DUMMY_OBJECT);
    log.setScheduled(true);
  }
  finally {
    log.endProcess();
  }
}
Program: 49383
Project: 49383
Buggy source:
public final void beforeRun() throws Exception {
  if (state == Transaction.State.ACTIVE) {
    innerBeforeRun();
  }
}

Fixed version (ground truth):
public final void beforeRun() throws Exception {
  if (state == Transaction.State.ACTIVE) {
    final TransactionManagerServiceImpl txService=(TransactionManagerServiceImpl)getNodeEngine().getTransactionManagerService();
    txService.addTransactionalOperation(getPartitionId(),this);
    innerBeforeRun();
  }
}
Program: 49384
Project: 49384
Buggy source:
public final void run() throws Exception {
switch (state) {
case ACTIVE:
    process();
  addTransactionRecord();
break;
case PREPARED:
prepare();
break;
case COMMITTED:
commit();
break;
case ROLLED_BACK:
rollback();
break;
default :
throw new IllegalStateException();
}
}

Fixed version (ground truth):
public final void run() throws Exception {
switch (state) {
case ACTIVE:
    process();
  break;
case PREPARED:
prepare();
break;
case COMMITTED:
commit();
break;
case ROLLED_BACK:
rollback();
break;
default :
throw new IllegalStateException();
}
}
Program: 49386
Project: 49386
Buggy source:
private boolean checkLimits(MapContainer mapContainer){
  MaxSizeConfig maxSizeConfig=mapContainer.getMapConfig().getMaxSizeConfig();
  MaxSizeConfig.MaxSizePolicy maxSizePolicy=maxSizeConfig.getMaxSizePolicy();
  String mapName=mapContainer.getName();
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    int totalSize=0;
    for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
      Address owner=nodeEngine.getPartitionService().getPartitionOwner(i);
      if (nodeEngine.getThisAddress().equals(owner)) {
        int size=partitionContainers[i].getRecordStore(mapName).getRecords().size();
        if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
          if (size >= maxSizeConfig.getSize())           return true;
        }
 else {
          totalSize+=size;
        }
      }
    }
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE)     return totalSize >= maxSizeConfig.getSize();
 else     return false;
  }
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_PERCENTAGE) {
    long total=Runtime.getRuntime().totalMemory();
    long used=(total - Runtime.getRuntime().freeMemory());
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE) {
      return maxSizeConfig.getSize() > (used / 1024 / 1024);
    }
 else {
      return maxSizeConfig.getSize() > (used / total);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean checkLimits(MapContainer mapContainer){
  MaxSizeConfig maxSizeConfig=mapContainer.getMapConfig().getMaxSizeConfig();
  MaxSizeConfig.MaxSizePolicy maxSizePolicy=maxSizeConfig.getMaxSizePolicy();
  String mapName=mapContainer.getName();
  int maxSize=maxSizeConfig.getSize() * 95 / 100;
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    int totalSize=0;
    for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
      Address owner=nodeEngine.getPartitionService().getPartitionOwner(i);
      if (nodeEngine.getThisAddress().equals(owner)) {
        int size=partitionContainers[i].getRecordStore(mapName).getRecords().size();
        if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
          if (size >= maxSize)           return true;
        }
 else {
          totalSize+=size;
        }
      }
    }
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE)     return totalSize >= maxSize;
 else     return false;
  }
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_PERCENTAGE) {
    long total=Runtime.getRuntime().totalMemory();
    long used=(total - Runtime.getRuntime().freeMemory());
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE) {
      return maxSize > (used / 1024 / 1024);
    }
 else {
      return maxSize > (used / total);
    }
  }
  return false;
}
Program: 49389
Project: 49389
Buggy source:
public void init(final NodeEngine nodeEngine,Properties properties){
  int partitionCount=nodeEngine.getPartitionService().getPartitionCount();
  for (int i=0; i < partitionCount; i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().scheduleAtFixedRate(new MapEvictTask(),3,1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public void init(final NodeEngine nodeEngine,Properties properties){
  int partitionCount=nodeEngine.getPartitionService().getPartitionCount();
  for (int i=0; i < partitionCount; i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().scheduleAtFixedRate(new MapEvictTask(),1,1,TimeUnit.SECONDS);
}
Program: 49390
Project: 49390
Buggy source:
private EvictRunner(int mod,MapConfig mapConfig,int targetSizePerPartition,Comparator comparator){
  this.mod=mod;
  mapName=mapConfig.getName();
  this.targetSizePerPartition=targetSizePerPartition;
  this.comparator=comparator;
  maxSizePolicy=mapConfig.getMaxSizeConfig().getMaxSizePolicy();
}

Fixed version (ground truth):
private EvictRunner(int mod,MapConfig mapConfig,int targetSizePerPartition,Comparator comparator,int evictionPercentage){
  this.mod=mod;
  mapName=mapConfig.getName();
  this.targetSizePerPartition=targetSizePerPartition;
  this.evictionPercentage=evictionPercentage;
  this.comparator=comparator;
  maxSizePolicy=mapConfig.getMaxSizeConfig().getMaxSizePolicy();
}
Program: 49391
Project: 49391
Buggy source:
public void run(){
  for (int j=0; j < 100000; j++) {
    map.put("String_Node_Str" + j,j);
  }
  latch.countDown();
}

Fixed version (ground truth):
public void run(){
  for (int j=0; j < 100000; j++) {
    map.put(k + "String_Node_Str" + j,j);
  }
  latch.countDown();
}
Program: 49393
Project: 49393
Buggy source:
public void run(){
  if (prepareTransaction()) {
    return;
  }
  evicted=recordStore.evict(dataKey);
}

Fixed version (ground truth):
public void run(){
  if (prepareTransaction()) {
    return;
  }
  dataValue=mapService.toData(recordStore.evict(dataKey));
  evicted=dataValue != null;
}
Program: 49394
Project: 49394
Buggy source:
public void afterRun(){
  mapService.interceptAfterProcess(name,MapOperationType.EVICT,dataKey,dataValue,dataValue);
  int eventType=EntryEvent.TYPE_EVICTED;
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,null,dataValue);
  invalidateNearCaches();
}

Fixed version (ground truth):
public void afterRun(){
  mapService.interceptAfterProcess(name,MapOperationType.EVICT,dataKey,dataValue,dataValue);
  int eventType=EntryEvent.TYPE_EVICTED;
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataValue,null);
  invalidateNearCaches();
}
Program: 49395
Project: 49395
Buggy source:
private boolean checkLimits(MapContainer mapContainer){
  MaxSizeConfig maxSizeConfig=mapContainer.getMapConfig().getMaxSizeConfig();
  MaxSizeConfig.MaxSizePolicy maxSizePolicy=maxSizeConfig.getMaxSizePolicy();
  String mapName=mapContainer.getName();
  int maxSize=maxSizeConfig.getSize() * 95 / 100;
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    int totalSize=0;
    for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
      Address owner=nodeEngine.getPartitionService().getPartitionOwner(i);
      if (nodeEngine.getThisAddress().equals(owner)) {
        int size=partitionContainers[i].getRecordStore(mapName).getRecords().size();
        if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
          if (size >= maxSize)           return true;
        }
 else {
          totalSize+=size;
        }
      }
    }
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE)     return totalSize >= maxSize;
 else     return false;
  }
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_PERCENTAGE) {
    long total=Runtime.getRuntime().totalMemory();
    long used=(total - Runtime.getRuntime().freeMemory());
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE) {
      return maxSize > (used / 1024 / 1024);
    }
 else {
      return maxSize > (used / total);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean checkLimits(MapContainer mapContainer){
  MaxSizeConfig maxSizeConfig=mapContainer.getMapConfig().getMaxSizeConfig();
  MaxSizeConfig.MaxSizePolicy maxSizePolicy=maxSizeConfig.getMaxSizePolicy();
  String mapName=mapContainer.getName();
  int maxSize=maxSizeConfig.getSize() * 95 / 100;
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
    int totalSize=0;
    for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
      Address owner=nodeEngine.getPartitionService().getPartitionOwner(i);
      if (nodeEngine.getThisAddress().equals(owner)) {
        int size=partitionContainers[i].getRecordStore(mapName).getRecords().size();
        if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_PARTITION) {
          if (size >= maxSize) {
            return true;
          }
        }
 else {
          totalSize+=size;
        }
      }
    }
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.PER_NODE)     return totalSize >= maxSize;
 else     return false;
  }
  if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE || maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_PERCENTAGE) {
    long total=Runtime.getRuntime().totalMemory();
    long used=(total - Runtime.getRuntime().freeMemory());
    if (maxSizePolicy == MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE) {
      return maxSize > (used / 1024 / 1024);
    }
 else {
      return maxSize > (used / total);
    }
  }
  return false;
}
Program: 49397
Project: 49397
Buggy source:
public boolean evict(Data dataKey){
  Record record=records.get(dataKey);
  if (record != null) {
    mapService.intercept(name,MapOperationType.EVICT,dataKey,record.getValue(),record.getValue());
    records.remove(dataKey);
    removeIndex(dataKey);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public Object evict(Data dataKey){
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record != null) {
    mapService.intercept(name,MapOperationType.EVICT,dataKey,record.getValue(),record.getValue());
    oldValue=record.getValue();
    records.remove(dataKey);
    removeIndex(dataKey);
  }
  return oldValue;
}
Program: 49398
Project: 49398
Buggy source:
boolean evict(Data key);

Fixed version (ground truth):
Object evict(Data key);
Program: 49399
Project: 49399
Buggy source:
@Override public void process(EntryTaskScheduler scheduler,Collection<ScheduledEntry<Data,Object>> entries){
  System.out.println("String_Node_Str" + entries.size());
  for (  ScheduledEntry<Data,Object> entry : entries) {
    Data key=entry.getKey();
    Operation operation=new EvictOperation(mapName,key,null);
    int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
    try {
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      Future f=invocation.invoke();
      f.get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
}

Fixed version (ground truth):
@Override public void process(EntryTaskScheduler scheduler,Collection<ScheduledEntry<Data,Object>> entries){
  for (  ScheduledEntry<Data,Object> entry : entries) {
    Data key=entry.getKey();
    Operation operation=new EvictOperation(mapName,key,null);
    int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
    try {
      Invocation invocation=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).build();
      Future f=invocation.invoke();
      f.get();
    }
 catch (    Throwable t) {
      throw ExceptionUtil.rethrow(t);
    }
  }
}
Program: 49400
Project: 49400
Buggy source:
public Record createRecord(String name,Data dataKey,Object value,long ttl){
  Record record=null;
  MapContainer mapContainer=getMapContainer(name);
  final MapConfig.RecordType recordType=mapContainer.getMapConfig().getRecordType();
  if (recordType == MapConfig.RecordType.DATA) {
    record=new DataRecord(dataKey,toData(value));
  }
 else   if (recordType == MapConfig.RecordType.OBJECT) {
    record=new ObjectRecord(dataKey,toObject(value));
  }
 else   if (recordType == MapConfig.RecordType.CACHED) {
    record=new CachedDataRecord(dataKey,toData(value));
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (ttl <= 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
    record.getState().updateTtlExpireTime(mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    scheduleTtlEviction(name,dataKey,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
  }
  if (ttl > 0) {
    record.getState().updateTtlExpireTime(ttl);
    scheduleTtlEviction(name,record.getKey(),ttl);
  }
  if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
    record.getState().updateIdleExpireTime(mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
  }
  return record;
}

Fixed version (ground truth):
public Record createRecord(String name,Data dataKey,Object value,long ttl,boolean backup){
  Record record=null;
  MapContainer mapContainer=getMapContainer(name);
  final MapConfig.RecordType recordType=mapContainer.getMapConfig().getRecordType();
  if (recordType == MapConfig.RecordType.DATA) {
    record=new DataRecord(dataKey,toData(value));
  }
 else   if (recordType == MapConfig.RecordType.OBJECT) {
    record=new ObjectRecord(dataKey,toObject(value));
  }
 else   if (recordType == MapConfig.RecordType.CACHED) {
    record=new CachedDataRecord(dataKey,toData(value));
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!backup) {
    if (ttl <= 0 && mapContainer.getMapConfig().getTimeToLiveSeconds() > 0) {
      record.getState().updateTtlExpireTime(mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
      scheduleTtlEviction(name,dataKey,mapContainer.getMapConfig().getTimeToLiveSeconds() * 1000);
    }
    if (ttl > 0) {
      record.getState().updateTtlExpireTime(ttl);
      scheduleTtlEviction(name,record.getKey(),ttl);
    }
    if (mapContainer.getMapConfig().getMaxIdleSeconds() > 0) {
      record.getState().updateIdleExpireTime(mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
      scheduleIdleEviction(name,dataKey,mapContainer.getMapConfig().getMaxIdleSeconds() * 1000);
    }
  }
  return record;
}
Program: 49401
Project: 49401
Buggy source:
@Override public void process(EntryTaskScheduler scheduler,Collection<ScheduledEntry<Data,Object>> entries){
  System.out.println("String_Node_Str" + entries.size());
  for (  ScheduledEntry<Data,Object> entry : entries) {
    System.out.println("String_Node_Str" + mapService.toObject(entry.getKey()) + "String_Node_Str"+ mapService.toObject(entry.getValue()));
    mapContainer.getStore().store(mapService.toObject(entry.getKey()),mapService.toObject(entry.getValue()));
  }
}

Fixed version (ground truth):
@Override public void process(EntryTaskScheduler scheduler,Collection<ScheduledEntry<Data,Object>> entries){
  for (  ScheduledEntry<Data,Object> entry : entries) {
    mapContainer.getStore().store(mapService.toObject(entry.getKey()),mapService.toObject(entry.getValue()));
  }
}
Program: 49402
Project: 49402
Buggy source:
public void run(){
  MapService mapService=(MapService)getService();
  int partitionId=getPartitionId();
  RecordStore recordStore=mapService.getRecordStore(partitionId,name);
  Record record=recordStore.getRecords().get(dataKey);
  if (record == null) {
    record=mapService.createRecord(name,dataKey,dataValue,ttl);
    recordStore.getRecords().put(dataKey,record);
  }
 else {
    recordStore.setRecordValue(record,dataValue);
  }
}

Fixed version (ground truth):
public void run(){
  MapService mapService=(MapService)getService();
  int partitionId=getPartitionId();
  RecordStore recordStore=mapService.getRecordStore(partitionId,name);
  Record record=recordStore.getRecords().get(dataKey);
  if (record == null) {
    record=mapService.createRecord(name,dataKey,dataValue,ttl,true);
    recordStore.getRecords().put(dataKey,record);
  }
 else {
    if (record instanceof DataRecord)     ((DataRecord)record).setValue(dataValue);
 else     if (record instanceof ObjectRecord)     ((ObjectRecord)record).setValue(mapService.toObject(dataValue));
  }
}
Program: 49403
Project: 49403
Buggy source:
private boolean scheduleEntry(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  final Integer existingSecond=secondsOfKeys.put(key,newSecond);
  if (existingSecond != null) {
    if (existingSecond.equals(newSecond)) {
      System.out.println("String_Node_Str" + existingSecond + "String_Node_Str"+ newSecond);
      return false;
    }
    removeKeyFromSecond(key,existingSecond);
  }
  doSchedule(new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}

Fixed version (ground truth):
private boolean scheduleEntry(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  final Integer existingSecond=secondsOfKeys.put(key,newSecond);
  if (existingSecond != null) {
    if (existingSecond.equals(newSecond)) {
      return false;
    }
    removeKeyFromSecond(key,existingSecond);
  }
  doSchedule(new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}
Program: 49404
Project: 49404
Buggy source:
private void removeKeyFromSecond(K key,Integer existingSecond){
  ConcurrentMap<K,ScheduledEntry<K,V>> scheduledKeys=scheduledEntries.get(existingSecond);
  if (scheduledKeys != null) {
    scheduledKeys.remove(key);
    System.out.println("String_Node_Str" + key);
  }
}

Fixed version (ground truth):
private void removeKeyFromSecond(K key,Integer existingSecond){
  ConcurrentMap<K,ScheduledEntry<K,V>> scheduledKeys=scheduledEntries.get(existingSecond);
  if (scheduledKeys != null) {
    scheduledKeys.remove(key);
  }
}
Program: 49405
Project: 49405
Buggy source:
/** 
 * Creates a new SecondExecutorService that will execute each entry one by one. Imagine a map with entries with different max-idle-seconds. Note that each key can be rescheduled and its execution can be postponed. So two things to remember: 1. a key can be rescheduled any number of times so its execution can be postponed. 2. each entry is executed individually. Once a key is executed, it can be re-scheduled for another execution. <p/> SecondExecutorService implementation is thread-safe.
 * @param es  ScheduledExecutorService instance to execute the second
 * @param stf entry executor
 * @return SecondExecutorService
 */
public SecondExecutorService newSecondEntryExecutor(ScheduledExecutorService es,SecondEntryTaskFactory stf){
  return new SecondScheduler(es,stf);
}

Fixed version (ground truth):
/** 
 * Creates a new SecondExecutorService that will execute each entry one by one. Imagine a map with entries with different max-idle-seconds. Note that each key can be rescheduled and its execution can be postponed. So two things to remember: 1. a key can be rescheduled any number of times so its execution can be postponed. 2. each entry is executed individually. Once a key is executed, it can be re-scheduled for another execution. <p/> SecondExecutorService implementation is thread-safe.
 * @param es  ScheduledExecutorService instance to execute the second
 * @param stf entry executor
 * @return SecondExecutorService
 */
public static SecondExecutorService newSecondEntryExecutor(ScheduledExecutorService es,SecondEntryTaskFactory stf){
  return new SecondScheduler(es,stf);
}