nus-yam/ex-repair huggingface dataset:
Program: 46812
Project: 46812
Buggy source:
@Override public CacheOperationProvider getCacheOperationProvider(String nameWithPrefix,InMemoryFormat inMemoryFormat){
  if (InMemoryFormat.NATIVE.equals(inMemoryFormat)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  CacheOperationProvider cacheOperationProvider=operationProviderCache.get(nameWithPrefix);
  if (cacheOperationProvider != null) {
    return cacheOperationProvider;
  }
  cacheOperationProvider=new DefaultOperationProvider(nameWithPrefix);
  CacheOperationProvider current=operationProviderCache.putIfAbsent(nameWithPrefix,cacheOperationProvider);
  return current == null ? cacheOperationProvider : current;
}

Fixed version (ground truth):
@Override public CacheOperationProvider getCacheOperationProvider(String nameWithPrefix,InMemoryFormat inMemoryFormat){
  if (InMemoryFormat.NATIVE.equals(inMemoryFormat)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  CacheOperationProvider cacheOperationProvider=operationProviderCache.get(nameWithPrefix);
  if (cacheOperationProvider != null) {
    return cacheOperationProvider;
  }
  cacheOperationProvider=new DefaultOperationProvider(nameWithPrefix);
  CacheOperationProvider current=operationProviderCache.putIfAbsent(nameWithPrefix,cacheOperationProvider);
  return current == null ? cacheOperationProvider : current;
}
Program: 46813
Project: 46813
Buggy source:
public R newRecordWithExpiry(Object value,long creationTime,long expiryTime){
  final R record;
switch (inMemoryFormat) {
case BINARY:
    Data dataValue=serializationService.toData(value);
  record=(R)createCacheDataRecord(dataValue,creationTime,expiryTime);
break;
case OBJECT:
Object objectValue=serializationService.toObject(value);
record=(R)createCacheObjectRecord(objectValue,creationTime,expiryTime);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + inMemoryFormat);
}
return record;
}

Fixed version (ground truth):
public R newRecordWithExpiry(Object value,long creationTime,long expiryTime){
  final R record;
switch (inMemoryFormat) {
case BINARY:
    Data dataValue=serializationService.toData(value);
  record=(R)createCacheDataRecord(dataValue,creationTime,expiryTime);
break;
case OBJECT:
Object objectValue=serializationService.toObject(value);
record=(R)createCacheObjectRecord(objectValue,creationTime,expiryTime);
break;
case NATIVE:
throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
default :
throw new IllegalArgumentException("String_Node_Str" + inMemoryFormat);
}
return record;
}
Program: 46814
Project: 46814
Buggy source:
ConstructorFunction<Void,RecordFactory> createRecordFactoryConstructor(final SerializationService serializationService){
  return new ConstructorFunction<Void,RecordFactory>(){
    @Override public RecordFactory createNew(    Void notUsedArg){
      RecordFactory recordFactory;
switch (mapConfig.getInMemoryFormat()) {
case BINARY:
        recordFactory=new DataRecordFactory(mapConfig,serializationService,partitioningStrategy);
      break;
case OBJECT:
    recordFactory=new ObjectRecordFactory(mapConfig,serializationService);
  break;
default :
throw new IllegalArgumentException("String_Node_Str" + mapConfig.getInMemoryFormat());
}
return recordFactory;
}
}
;
}

Fixed version (ground truth):
ConstructorFunction<Void,RecordFactory> createRecordFactoryConstructor(final SerializationService serializationService){
  return new ConstructorFunction<Void,RecordFactory>(){
    @Override public RecordFactory createNew(    Void notUsedArg){
      RecordFactory recordFactory;
switch (mapConfig.getInMemoryFormat()) {
case BINARY:
        recordFactory=new DataRecordFactory(mapConfig,serializationService,partitioningStrategy);
      break;
case OBJECT:
    recordFactory=new ObjectRecordFactory(mapConfig,serializationService);
  break;
case NATIVE:
throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
default :
throw new IllegalArgumentException("String_Node_Str" + mapConfig.getInMemoryFormat());
}
return recordFactory;
}
}
;
}
Program: 46815
Project: 46815
Buggy source:
@Override public RecordFactory createNew(Void notUsedArg){
  RecordFactory recordFactory;
switch (mapConfig.getInMemoryFormat()) {
case BINARY:
    recordFactory=new DataRecordFactory(mapConfig,serializationService,partitioningStrategy);
  break;
case OBJECT:
recordFactory=new ObjectRecordFactory(mapConfig,serializationService);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + mapConfig.getInMemoryFormat());
}
return recordFactory;
}

Fixed version (ground truth):
@Override public RecordFactory createNew(Void notUsedArg){
  RecordFactory recordFactory;
switch (mapConfig.getInMemoryFormat()) {
case BINARY:
    recordFactory=new DataRecordFactory(mapConfig,serializationService,partitioningStrategy);
  break;
case OBJECT:
recordFactory=new ObjectRecordFactory(mapConfig,serializationService);
break;
case NATIVE:
throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
default :
throw new IllegalArgumentException("String_Node_Str" + mapConfig.getInMemoryFormat());
}
return recordFactory;
}
Program: 46816
Project: 46816
Buggy source:
@Override public void memberRemoved(final MemberImpl member){
  logger.info("String_Node_Str" + member);
  updateMemberGroupsSize();
  final Address deadAddress=member.getAddress();
  final Address thisAddress=node.getThisAddress();
  if (thisAddress.equals(deadAddress)) {
    return;
  }
  lock.lock();
  try {
    if (initialized && node.getClusterService().getClusterState() == ClusterState.ACTIVE) {
      stateVersion.incrementAndGet();
    }
    migrationQueue.clear();
    if (!activeMigrations.isEmpty()) {
      if (node.isMaster()) {
        rollbackActiveMigrationsFromPreviousMaster(node.getLocalMember().getUuid());
      }
      for (      MigrationInfo migrationInfo : activeMigrations.values()) {
        if (deadAddress.equals(migrationInfo.getSource()) || deadAddress.equals(migrationInfo.getDestination())) {
          migrationInfo.invalidate();
        }
      }
    }
    pauseMigration();
    cancelReplicaSyncRequestsInternal(deadAddress);
    removeDeadAddress(deadAddress,thisAddress);
    if (node.isMaster() && initialized) {
      migrationQueue.add(new RepartitioningTask());
    }
    resumeMigrationEventually();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void memberRemoved(final MemberImpl member){
  logger.info("String_Node_Str" + member);
  updateMemberGroupsSize();
  final Address deadAddress=member.getAddress();
  final Address thisAddress=node.getThisAddress();
  if (thisAddress.equals(deadAddress)) {
    return;
  }
  lock.lock();
  try {
    if (initialized && node.getClusterService().getClusterState() == ClusterState.ACTIVE) {
      stateVersion.incrementAndGet();
    }
    migrationQueue.clear();
    if (node.isMaster()) {
      rollbackActiveMigrationsFromPreviousMaster(node.getLocalMember().getUuid());
    }
    invalidateActiveMigrationsBelongingTo(deadAddress);
    pauseMigration();
    cancelReplicaSyncRequestsInternal(deadAddress);
    removeDeadAddress(deadAddress,thisAddress);
    if (node.isMaster() && initialized) {
      migrationQueue.add(new RepartitioningTask());
    }
    resumeMigrationEventually();
  }
  finally {
    lock.unlock();
  }
}
Program: 46817
Project: 46817
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ scheduledDelayMillis+ "String_Node_Str"+ actualDelaySeconds+ "String_Node_Str"+ scheduleStartTimeInNanos+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ scheduledDelayMillis+ "String_Node_Str"+ actualDelaySeconds+ "String_Node_Str"+ scheduleId+ '}';
}
Program: 46818
Project: 46818
Buggy source:
public ScheduledEntry(K key,V value,long scheduledDelayMillis,int actualDelaySeconds,long scheduleStartTimeInNanos){
  this.key=key;
  this.value=value;
  this.scheduledDelayMillis=scheduledDelayMillis;
  this.actualDelaySeconds=actualDelaySeconds;
  this.scheduleStartTimeInNanos=scheduleStartTimeInNanos;
}

Fixed version (ground truth):
public ScheduledEntry(K key,V value,long scheduledDelayMillis,int actualDelaySeconds,long scheduleId){
  this.key=key;
  this.value=value;
  this.scheduledDelayMillis=scheduledDelayMillis;
  this.actualDelaySeconds=actualDelaySeconds;
  this.scheduleId=scheduleId;
}
Program: 46819
Project: 46819
Buggy source:
@Override public ScheduledEntry<K,V> cancel(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByTimeKey(key);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return null;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return null;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key);
}

Fixed version (ground truth):
@Override public ScheduledEntry<K,V> cancel(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByCompositeKey(key);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return null;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return null;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key);
}
Program: 46820
Project: 46820
Buggy source:
@Override public int compare(ScheduledEntry o1,ScheduledEntry o2){
  if (o1.getScheduleStartTimeInNanos() > o2.getScheduleStartTimeInNanos()) {
    return 1;
  }
 else   if (o1.getScheduleStartTimeInNanos() < o2.getScheduleStartTimeInNanos()) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(ScheduledEntry o1,ScheduledEntry o2){
  if (o1.getScheduleId() > o2.getScheduleId()) {
    return 1;
  }
 else   if (o1.getScheduleId() < o2.getScheduleId()) {
    return -1;
  }
  return 0;
}
Program: 46821
Project: 46821
Buggy source:
@Override public void run(){
  scheduledTaskMap.remove(second);
  final Map<Object,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 (  Map.Entry<Object,ScheduledEntry<K,V>> entry : entries.entrySet()) {
    Integer removed=secondsOfKeys.remove(entry.getKey());
    if (removed != null) {
      values.add(entry.getValue());
    }
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,sortForEntryProcessing(values));
}

Fixed version (ground truth):
@Override public void run(){
  scheduledTaskMap.remove(second);
  final Map<Object,ScheduledEntry<K,V>> entries=scheduledEntries.remove(second);
  if (entries == null || entries.isEmpty()) {
    return;
  }
  List<ScheduledEntry<K,V>> values=new ArrayList<ScheduledEntry<K,V>>(entries.size());
  for (  Map.Entry<Object,ScheduledEntry<K,V>> entry : entries.entrySet()) {
    Integer removed=secondsOfKeys.remove(entry.getKey());
    if (removed != null) {
      values.add(entry.getValue());
    }
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,sortForEntryProcessing(values));
}
Program: 46822
Project: 46822
Buggy source:
private boolean scheduleEntry(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  long time=System.nanoTime();
  TimeKey timeKey=new TimeKey(key,time);
  secondsOfKeys.put(timeKey,newSecond);
  doSchedule(timeKey,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,time),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 long id=uniqueIdGenerator.incrementAndGet();
  Object compositeKey=new CompositeKey(key,id);
  secondsOfKeys.put(compositeKey,newSecond);
  doSchedule(compositeKey,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46823
Project: 46823
Buggy source:
@Override public Set<K> flush(Set<K> keys){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return flushByTimeKeys(keys);
  }
  Set<ScheduledEntry<K,V>> res=new HashSet<ScheduledEntry<K,V>>(keys.size());
  Set<K> processedKeys=new HashSet<K>();
  for (  K key : keys) {
    final Integer second=secondsOfKeys.remove(key);
    if (second != null) {
      final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
      if (entries != null) {
        processedKeys.add(key);
        res.add(entries.remove(key));
      }
    }
  }
  entryProcessor.process(this,sortForEntryProcessing(res));
  return processedKeys;
}

Fixed version (ground truth):
@Override public Set<K> flush(Set<K> keys){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return flushByCompositeKeys(keys);
  }
  List<ScheduledEntry<K,V>> res=new ArrayList<ScheduledEntry<K,V>>(keys.size());
  Set<K> processedKeys=new HashSet<K>();
  for (  K key : keys) {
    final Integer second=secondsOfKeys.remove(key);
    if (second != null) {
      final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
      if (entries != null) {
        processedKeys.add(key);
        res.add(entries.remove(key));
      }
    }
  }
  entryProcessor.process(this,sortForEntryProcessing(res));
  return processedKeys;
}
Program: 46824
Project: 46824
Buggy source:
@Override public ScheduledEntry<K,V> get(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return getByTimeKey(key);
  }
  final Integer second=secondsOfKeys.get(key);
  if (second != null) {
    final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
    if (entries != null) {
      return entries.get(key);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public ScheduledEntry<K,V> get(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return getByCompositeKey(key);
  }
  final Integer second=secondsOfKeys.get(key);
  if (second != null) {
    final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
    if (entries != null) {
      return entries.get(key);
    }
  }
  return null;
}
Program: 46825
Project: 46825
Buggy source:
private boolean schedulePostponeEntry(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(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}

Fixed version (ground truth):
private boolean schedulePostponeEntry(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);
  }
  final long id=uniqueIdGenerator.incrementAndGet();
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46826
Project: 46826
Buggy source:
private boolean scheduleIfNew(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  if (secondsOfKeys.putIfAbsent(key,newSecond) != null) {
    return false;
  }
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}

Fixed version (ground truth):
private boolean scheduleIfNew(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  if (secondsOfKeys.putIfAbsent(key,newSecond) != null) {
    return false;
  }
  final long id=uniqueIdGenerator.incrementAndGet();
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46827
Project: 46827
Buggy source:
private List<ScheduledEntry<K,V>> sortForEntryProcessing(Set<ScheduledEntry<K,V>> coll){
  if (coll == null || coll.isEmpty()) {
    return Collections.emptyList();
  }
  final List<ScheduledEntry<K,V>> sortedEntries=new ArrayList<ScheduledEntry<K,V>>(coll);
  Collections.sort(sortedEntries,SCHEDULED_ENTRIES_COMPARATOR);
  return sortedEntries;
}

Fixed version (ground truth):
private List<ScheduledEntry<K,V>> sortForEntryProcessing(List<ScheduledEntry<K,V>> coll){
  if (coll == null || coll.isEmpty()) {
    return Collections.emptyList();
  }
  Collections.sort(coll,SCHEDULED_ENTRIES_COMPARATOR);
  return coll;
}
Program: 46828
Project: 46828
Buggy source:
@Override public int cancelIfExists(K key,V value){
  final ScheduledEntry<K,V> scheduledEntry=new ScheduledEntry<K,V>(key,value,0,0);
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByTimeKey(key,scheduledEntry);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return 0;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return 0;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key,scheduledEntry) ? 1 : 0;
}

Fixed version (ground truth):
@Override public int cancelIfExists(K key,V value){
  final ScheduledEntry<K,V> scheduledEntry=new ScheduledEntry<K,V>(key,value,0,0,0);
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByCompositeKey(key,scheduledEntry);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return 0;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return 0;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key,scheduledEntry) ? 1 : 0;
}
Program: 46829
Project: 46829
Buggy source:
/** 
 * Instantiates a new Clustered session service.
 * @param filterConfig   the filter config
 * @param properties     the properties
 * @param clusterMapName the cluster map name
 * @param sessionTTL     the session tTL
 */
public ClusteredSessionService(FilterConfig filterConfig,Properties properties,String clusterMapName,String sessionTTL){
  this.filterConfig=filterConfig;
  this.properties=properties;
  this.clusterMapName=clusterMapName;
  this.sessionTTL=sessionTTL;
  try {
    ensureInstance();
  }
 catch (  Exception ignored) {
    EmptyStatement.ignore(ignored);
  }
  es.scheduleWithFixedDelay(new Runnable(){
    public void run(){
      try {
        ensureInstance();
      }
 catch (      Exception ignored) {
        EmptyStatement.ignore(ignored);
      }
    }
  }
,CLUSTER_CHECK_INTERVAL,CLUSTER_CHECK_INTERVAL,TimeUnit.SECONDS);
}

Fixed version (ground truth):
/** 
 * Instantiates a new Clustered session service.
 * @param filterConfig   the filter config
 * @param properties     the properties
 * @param clusterMapName the cluster map name
 */
public ClusteredSessionService(FilterConfig filterConfig,Properties properties,String clusterMapName){
  this.filterConfig=filterConfig;
  this.properties=properties;
  this.clusterMapName=clusterMapName;
  try {
    init();
  }
 catch (  Exception e) {
    ExceptionUtil.rethrow(e);
  }
}
Program: 46830
Project: 46830
Buggy source:
private void ensureInstance() throws Exception {
  if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
synchronized (this) {
      try {
        if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
          reconnectHZInstansce();
          clearOrphanSessionQueue();
        }
      }
 catch (      Exception e) {
        failedConnection=true;
        throw e;
      }
    }
  }
}

Fixed version (ground truth):
private void ensureInstance() throws Exception {
  if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
synchronized (this) {
      try {
        if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
          reconnectHZInstance();
          clearOrphanSessionQueue();
        }
      }
 catch (      Exception e) {
        setFailedConnection(true);
        if (LOGGER.isFinestEnabled()) {
          LOGGER.finest("String_Node_Str",e);
        }
      }
    }
  }
}
Program: 46831
Project: 46831
Buggy source:
/** 
 * Execute on key.
 * @param sessionId the session id
 * @param processor the processor
 * @return the object
 * @throws Exception the exception
 */
Object executeOnKey(String sessionId,EntryProcessor processor) throws Exception {
  try {
    ensureInstance();
    if (processor instanceof JvmIdAware) {
      ((JvmIdAware)processor).setJvmId(jvmId);
    }
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    failedConnection=true;
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Execute on key.
 * @param sessionId the session id
 * @param processor the processor
 * @return the object
 * @throws Exception
 */
Object executeOnKey(String sessionId,EntryProcessor processor) throws Exception {
  try {
    if (processor instanceof JvmIdAware) {
      ((JvmIdAware)processor).setJvmId(jvmId);
    }
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    LOGGER.finest("String_Node_Str",e);
    throw e;
  }
}
Program: 46832
Project: 46832
Buggy source:
public Object getAttribute(final String name){
  LocalCacheEntry cacheEntry=localCache.get(name);
  Object value=null;
  if (cacheEntry == null || cacheEntry.isReload()) {
    try {
      value=webFilter.getClusteredSessionService().getAttribute(id,name);
      cacheEntry=new LocalCacheEntry(false,value);
      cacheEntry.setReload(false);
      localCache.put(name,cacheEntry);
    }
 catch (    Exception e) {
      WebFilter.LOGGER.warning("String_Node_Str",e);
      if (cacheEntry == null) {
        return null;
      }
    }
  }
  if (cacheEntry.isRemoved()) {
    return null;
  }
  return cacheEntry.getValue();
}

Fixed version (ground truth):
public Object getAttribute(final String name){
  LocalCacheEntry cacheEntry=localCache.get(name);
  Object value=null;
  if (cacheEntry == null || cacheEntry.isReload()) {
    try {
      value=webFilter.getClusteredSessionService().getAttribute(id,name);
      cacheEntry=new LocalCacheEntry(false,value);
      cacheEntry.setReload(false);
      localCache.put(name,cacheEntry);
    }
 catch (    Exception e) {
      if (WebFilter.LOGGER.isFinestEnabled()) {
        WebFilter.LOGGER.finest("String_Node_Str",e);
      }
      if (cacheEntry == null) {
        return null;
      }
    }
  }
  if (cacheEntry.isRemoved()) {
    return null;
  }
  return cacheEntry.getValue();
}
Program: 46833
Project: 46833
Buggy source:
public static HazelcastInstance createInstance(final FilterConfig filterConfig,final Properties properties) throws ServletException {
  final String instanceName=properties.getProperty(INSTANCE_NAME);
  final String configLocation=properties.getProperty(CONFIG_LOCATION);
  final String useClientProp=properties.getProperty(USE_CLIENT);
  final String clientConfigLocation=properties.getProperty(CLIENT_CONFIG_LOCATION);
  final boolean useClient=!isEmpty(useClientProp) && Boolean.parseBoolean(useClientProp);
  URL configUrl=null;
  if (useClient && !isEmpty(clientConfigLocation)) {
    configUrl=getConfigURL(filterConfig,clientConfigLocation);
  }
 else   if (!isEmpty(configLocation)) {
    configUrl=getConfigURL(filterConfig,configLocation);
  }
  if (useClient) {
    return createClientInstance(configUrl);
  }
  Config config;
  if (configUrl == null) {
    config=new XmlConfigBuilder().build();
  }
 else {
    try {
      config=new UrlXmlConfig(configUrl);
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  return createHazelcastInstance(instanceName,config);
}

Fixed version (ground truth):
public static HazelcastInstance createInstance(final ClusteredSessionService sessionService,final FilterConfig filterConfig,final Properties properties) throws ServletException {
  final String instanceName=properties.getProperty(INSTANCE_NAME);
  final String configLocation=properties.getProperty(CONFIG_LOCATION);
  final String useClientProp=properties.getProperty(USE_CLIENT);
  final String clientConfigLocation=properties.getProperty(CLIENT_CONFIG_LOCATION);
  final boolean useClient=!isEmpty(useClientProp) && Boolean.parseBoolean(useClientProp);
  URL configUrl=null;
  if (useClient && !isEmpty(clientConfigLocation)) {
    configUrl=getConfigURL(filterConfig,clientConfigLocation);
  }
 else   if (!isEmpty(configLocation)) {
    configUrl=getConfigURL(filterConfig,configLocation);
  }
  if (useClient) {
    boolean isSticky=Boolean.valueOf(properties.getProperty(STICKY_SESSION_CONFIG));
    return createClientInstance(sessionService,instanceName,configUrl,isSticky);
  }
  Config config;
  if (configUrl == null) {
    config=new XmlConfigBuilder().build();
  }
 else {
    try {
      config=new UrlXmlConfig(configUrl);
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  return createHazelcastInstance(sessionService,instanceName,config);
}
Program: 46834
Project: 46834
Buggy source:
private static HazelcastInstance createHazelcastInstance(String instanceName,Config config){
  if (!isEmpty(instanceName)) {
    if (LOGGER.isLoggable(Level.INFO)) {
      LOGGER.info(format("String_Node_Str",instanceName));
    }
    config.setInstanceName(instanceName);
    return Hazelcast.getOrCreateHazelcastInstance(config);
  }
 else {
    LOGGER.info("String_Node_Str");
    return Hazelcast.newHazelcastInstance(config);
  }
}

Fixed version (ground truth):
private static HazelcastInstance createHazelcastInstance(ClusteredSessionService sessionService,String instanceName,Config config){
  ListenerConfig listenerConfig=new ListenerConfig(new ServerLifecycleListener(sessionService));
  config.addListenerConfig(listenerConfig);
  if (!isEmpty(instanceName)) {
    if (LOGGER.isLoggable(Level.INFO)) {
      LOGGER.info(format("String_Node_Str",instanceName));
    }
    config.setInstanceName(instanceName);
    return Hazelcast.getOrCreateHazelcastInstance(config);
  }
 else {
    LOGGER.info("String_Node_Str");
    return Hazelcast.newHazelcastInstance(config);
  }
}
Program: 46835
Project: 46835
Buggy source:
private static HazelcastInstance createClientInstance(URL configUrl) throws ServletException {
  LOGGER.warning("String_Node_Str");
  LOGGER.warning("String_Node_Str");
  ClientConfig clientConfig;
  if (configUrl == null) {
    clientConfig=new ClientConfig();
  }
 else {
    try {
      clientConfig=new XmlClientConfigBuilder(configUrl).build();
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
  return HazelcastClient.newHazelcastClient(clientConfig);
}

Fixed version (ground truth):
private static HazelcastInstance createClientInstance(ClusteredSessionService sessionService,String instanceName,URL configUrl,boolean isSticky) throws ServletException {
  LOGGER.warning("String_Node_Str");
  LOGGER.warning("String_Node_Str");
  ClientConfig clientConfig;
  if (configUrl == null) {
    clientConfig=new ClientConfig();
  }
 else {
    try {
      clientConfig=new XmlClientConfigBuilder(configUrl).build();
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  clientConfig.setInstanceName(instanceName);
  if (isSticky) {
    clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
  }
  ListenerConfig listenerConfig=new ListenerConfig(new ClientLifecycleListener(sessionService));
  clientConfig.addListenerConfig(listenerConfig);
  return HazelcastClient.newHazelcastClient(clientConfig);
}
Program: 46836
Project: 46836
Buggy source:
private void loadProperties() throws ServletException {
  if (properties == null) {
    properties=new Properties();
  }
  setProperty(HazelcastInstanceLoader.CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.INSTANCE_NAME);
  setProperty(HazelcastInstanceLoader.USE_CLIENT);
  setProperty(HazelcastInstanceLoader.CLIENT_CONFIG_LOCATION);
}

Fixed version (ground truth):
private void loadProperties() throws ServletException {
  if (properties == null) {
    properties=new Properties();
  }
  setProperty(HazelcastInstanceLoader.CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.INSTANCE_NAME);
  setProperty(HazelcastInstanceLoader.USE_CLIENT);
  setProperty(HazelcastInstanceLoader.CLIENT_CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.STICKY_SESSION_CONFIG);
}
Program: 46837
Project: 46837
Buggy source:
public final void init(final FilterConfig config) throws ServletException {
  filterConfig=config;
  servletContext=config.getServletContext();
  servletContext.setAttribute(WEB_FILTER_ATTRIBUTE_KEY,this);
  loadProperties();
  initCookieParams();
  initParams();
  String mapName=getParam("String_Node_Str");
  if (mapName == null) {
    mapName="String_Node_Str" + servletContext.getServletContextName();
  }
  String sessionTTL=getParam("String_Node_Str");
  clusteredSessionService=new ClusteredSessionService(filterConfig,properties,mapName,sessionTTL);
  if (LOGGER.isLoggable(Level.FINEST)) {
    LOGGER.finest("String_Node_Str" + stickySession + "String_Node_Str"+ shutdownOnDestroy+ "String_Node_Str"+ mapName);
  }
}

Fixed version (ground truth):
public final void init(final FilterConfig config) throws ServletException {
  filterConfig=config;
  servletContext=config.getServletContext();
  servletContext.setAttribute(WEB_FILTER_ATTRIBUTE_KEY,this);
  loadProperties();
  initCookieParams();
  initParams();
  String mapName=getParam("String_Node_Str");
  if (mapName == null) {
    mapName="String_Node_Str" + servletContext.getServletContextName();
  }
  clusteredSessionService=new ClusteredSessionService(filterConfig,properties,mapName);
  if (LOGGER.isLoggable(Level.FINEST)) {
    LOGGER.finest("String_Node_Str" + stickySession + "String_Node_Str"+ shutdownOnDestroy+ "String_Node_Str"+ mapName);
  }
}
Program: 46838
Project: 46838
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ scheduledDelayMillis+ "String_Node_Str"+ actualDelaySeconds+ "String_Node_Str"+ scheduleStartTimeInNanos+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str"+ scheduledDelayMillis+ "String_Node_Str"+ actualDelaySeconds+ "String_Node_Str"+ scheduleId+ '}';
}
Program: 46839
Project: 46839
Buggy source:
public ScheduledEntry(K key,V value,long scheduledDelayMillis,int actualDelaySeconds,long scheduleStartTimeInNanos){
  this.key=key;
  this.value=value;
  this.scheduledDelayMillis=scheduledDelayMillis;
  this.actualDelaySeconds=actualDelaySeconds;
  this.scheduleStartTimeInNanos=scheduleStartTimeInNanos;
}

Fixed version (ground truth):
public ScheduledEntry(K key,V value,long scheduledDelayMillis,int actualDelaySeconds,long scheduleId){
  this.key=key;
  this.value=value;
  this.scheduledDelayMillis=scheduledDelayMillis;
  this.actualDelaySeconds=actualDelaySeconds;
  this.scheduleId=scheduleId;
}
Program: 46840
Project: 46840
Buggy source:
@Override public ScheduledEntry<K,V> cancel(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByTimeKey(key);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return null;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return null;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key);
}

Fixed version (ground truth):
@Override public ScheduledEntry<K,V> cancel(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByCompositeKey(key);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return null;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return null;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key);
}
Program: 46841
Project: 46841
Buggy source:
@Override public int compare(ScheduledEntry o1,ScheduledEntry o2){
  if (o1.getScheduleStartTimeInNanos() > o2.getScheduleStartTimeInNanos()) {
    return 1;
  }
 else   if (o1.getScheduleStartTimeInNanos() < o2.getScheduleStartTimeInNanos()) {
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(ScheduledEntry o1,ScheduledEntry o2){
  if (o1.getScheduleId() > o2.getScheduleId()) {
    return 1;
  }
 else   if (o1.getScheduleId() < o2.getScheduleId()) {
    return -1;
  }
  return 0;
}
Program: 46842
Project: 46842
Buggy source:
@Override public void run(){
  scheduledTaskMap.remove(second);
  final Map<Object,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 (  Map.Entry<Object,ScheduledEntry<K,V>> entry : entries.entrySet()) {
    Integer removed=secondsOfKeys.remove(entry.getKey());
    if (removed != null) {
      values.add(entry.getValue());
    }
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,sortForEntryProcessing(values));
}

Fixed version (ground truth):
@Override public void run(){
  scheduledTaskMap.remove(second);
  final Map<Object,ScheduledEntry<K,V>> entries=scheduledEntries.remove(second);
  if (entries == null || entries.isEmpty()) {
    return;
  }
  List<ScheduledEntry<K,V>> values=new ArrayList<ScheduledEntry<K,V>>(entries.size());
  for (  Map.Entry<Object,ScheduledEntry<K,V>> entry : entries.entrySet()) {
    Integer removed=secondsOfKeys.remove(entry.getKey());
    if (removed != null) {
      values.add(entry.getValue());
    }
  }
  entryProcessor.process(SecondsBasedEntryTaskScheduler.this,sortForEntryProcessing(values));
}
Program: 46843
Project: 46843
Buggy source:
private boolean scheduleEntry(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  long time=System.nanoTime();
  TimeKey timeKey=new TimeKey(key,time);
  secondsOfKeys.put(timeKey,newSecond);
  doSchedule(timeKey,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,time),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 long id=uniqueIdGenerator.incrementAndGet();
  Object compositeKey=new CompositeKey(key,id);
  secondsOfKeys.put(compositeKey,newSecond);
  doSchedule(compositeKey,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46844
Project: 46844
Buggy source:
@Override public Set<K> flush(Set<K> keys){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return flushByTimeKeys(keys);
  }
  Set<ScheduledEntry<K,V>> res=new HashSet<ScheduledEntry<K,V>>(keys.size());
  Set<K> processedKeys=new HashSet<K>();
  for (  K key : keys) {
    final Integer second=secondsOfKeys.remove(key);
    if (second != null) {
      final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
      if (entries != null) {
        processedKeys.add(key);
        res.add(entries.remove(key));
      }
    }
  }
  entryProcessor.process(this,sortForEntryProcessing(res));
  return processedKeys;
}

Fixed version (ground truth):
@Override public Set<K> flush(Set<K> keys){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return flushByCompositeKeys(keys);
  }
  List<ScheduledEntry<K,V>> res=new ArrayList<ScheduledEntry<K,V>>(keys.size());
  Set<K> processedKeys=new HashSet<K>();
  for (  K key : keys) {
    final Integer second=secondsOfKeys.remove(key);
    if (second != null) {
      final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
      if (entries != null) {
        processedKeys.add(key);
        res.add(entries.remove(key));
      }
    }
  }
  entryProcessor.process(this,sortForEntryProcessing(res));
  return processedKeys;
}
Program: 46845
Project: 46845
Buggy source:
@Override public ScheduledEntry<K,V> get(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return getByTimeKey(key);
  }
  final Integer second=secondsOfKeys.get(key);
  if (second != null) {
    final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
    if (entries != null) {
      return entries.get(key);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public ScheduledEntry<K,V> get(K key){
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return getByCompositeKey(key);
  }
  final Integer second=secondsOfKeys.get(key);
  if (second != null) {
    final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
    if (entries != null) {
      return entries.get(key);
    }
  }
  return null;
}
Program: 46846
Project: 46846
Buggy source:
private boolean schedulePostponeEntry(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(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}

Fixed version (ground truth):
private boolean schedulePostponeEntry(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);
  }
  final long id=uniqueIdGenerator.incrementAndGet();
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46847
Project: 46847
Buggy source:
private boolean scheduleIfNew(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  if (secondsOfKeys.putIfAbsent(key,newSecond) != null) {
    return false;
  }
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds),newSecond);
  return true;
}

Fixed version (ground truth):
private boolean scheduleIfNew(long delayMillis,K key,V value){
  final int delaySeconds=ceilToSecond(delayMillis);
  final Integer newSecond=findRelativeSecond(delayMillis);
  if (secondsOfKeys.putIfAbsent(key,newSecond) != null) {
    return false;
  }
  final long id=uniqueIdGenerator.incrementAndGet();
  doSchedule(key,new ScheduledEntry<K,V>(key,value,delayMillis,delaySeconds,id),newSecond);
  return true;
}
Program: 46848
Project: 46848
Buggy source:
private List<ScheduledEntry<K,V>> sortForEntryProcessing(Set<ScheduledEntry<K,V>> coll){
  if (coll == null || coll.isEmpty()) {
    return Collections.emptyList();
  }
  final List<ScheduledEntry<K,V>> sortedEntries=new ArrayList<ScheduledEntry<K,V>>(coll);
  Collections.sort(sortedEntries,SCHEDULED_ENTRIES_COMPARATOR);
  return sortedEntries;
}

Fixed version (ground truth):
private List<ScheduledEntry<K,V>> sortForEntryProcessing(List<ScheduledEntry<K,V>> coll){
  if (coll == null || coll.isEmpty()) {
    return Collections.emptyList();
  }
  Collections.sort(coll,SCHEDULED_ENTRIES_COMPARATOR);
  return coll;
}
Program: 46849
Project: 46849
Buggy source:
@Override public int cancelIfExists(K key,V value){
  final ScheduledEntry<K,V> scheduledEntry=new ScheduledEntry<K,V>(key,value,0,0);
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByTimeKey(key,scheduledEntry);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return 0;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return 0;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key,scheduledEntry) ? 1 : 0;
}

Fixed version (ground truth):
@Override public int cancelIfExists(K key,V value){
  final ScheduledEntry<K,V> scheduledEntry=new ScheduledEntry<K,V>(key,value,0,0,0);
  if (scheduleType.equals(ScheduleType.FOR_EACH)) {
    return cancelByCompositeKey(key,scheduledEntry);
  }
  final Integer second=secondsOfKeys.remove(key);
  if (second == null) {
    return 0;
  }
  final ConcurrentMap<Object,ScheduledEntry<K,V>> entries=scheduledEntries.get(second);
  if (entries == null) {
    return 0;
  }
  return cancelAndCleanUpIfEmpty(second,entries,key,scheduledEntry) ? 1 : 0;
}
Program: 46850
Project: 46850
Buggy source:
/** 
 * Update attributes.
 * @param id the id
 * @param updates the updates
 * @throws Exception the exception
 */
public void updateAttributes(String id,Map<String,Object> updates) throws Exception {
  SerializationService ss=sss.getSerializationService();
  SessionUpdateEntryProcessor sessionUpdate=new SessionUpdateEntryProcessor(updates.size());
  sessionUpdate.setJvmId(jvmId);
  for (  Map.Entry<String,Object> entry : updates.entrySet()) {
    String name=entry.getKey();
    Object value=entry.getValue();
    sessionUpdate.getAttributes().put(name,ss.toData(value));
  }
  executeOnKey(id,sessionUpdate);
}

Fixed version (ground truth):
/** 
 * Update attributes.
 * @param id      the id
 * @param updates the updates
 * @throws Exception the exception
 */
public void updateAttributes(String id,Map<String,Object> updates) throws Exception {
  SerializationService ss=sss.getSerializationService();
  SessionUpdateEntryProcessor sessionUpdate=new SessionUpdateEntryProcessor(updates.size());
  sessionUpdate.setJvmId(jvmId);
  for (  Map.Entry<String,Object> entry : updates.entrySet()) {
    String name=entry.getKey();
    Object value=entry.getValue();
    sessionUpdate.getAttributes().put(name,ss.toData(value));
  }
  executeOnKey(id,sessionUpdate);
}
Program: 46851
Project: 46851
Buggy source:
/** 
 * Instantiates a new Clustered session service.
 * @param filterConfig the filter config
 * @param properties the properties
 * @param clusterMapName the cluster map name
 * @param sessionTTL the session tTL
 */
public ClusteredSessionService(FilterConfig filterConfig,Properties properties,String clusterMapName,String sessionTTL){
  this.filterConfig=filterConfig;
  this.properties=properties;
  this.clusterMapName=clusterMapName;
  this.sessionTTL=sessionTTL;
  try {
    ensureInstance();
  }
 catch (  Exception ignored) {
    EmptyStatement.ignore(ignored);
  }
  es.scheduleWithFixedDelay(new Runnable(){
    public void run(){
      try {
        ensureInstance();
      }
 catch (      Exception ignored) {
        EmptyStatement.ignore(ignored);
      }
    }
  }
,CLUSTER_CHECK_INTERVAL,CLUSTER_CHECK_INTERVAL,TimeUnit.SECONDS);
}

Fixed version (ground truth):
/** 
 * Instantiates a new Clustered session service.
 * @param filterConfig   the filter config
 * @param properties     the properties
 * @param clusterMapName the cluster map name
 */
public ClusteredSessionService(FilterConfig filterConfig,Properties properties,String clusterMapName){
  this.filterConfig=filterConfig;
  this.properties=properties;
  this.clusterMapName=clusterMapName;
  try {
    init();
  }
 catch (  Exception e) {
    ExceptionUtil.rethrow(e);
  }
}
Program: 46852
Project: 46852
Buggy source:
/** 
 * Delete session.
 * @param sessionId sessionId
 * @param invalidate if true remove the distributed session, otherwise justremove the jvm reference
 * @return the boolean
 */
public boolean deleteSession(String sessionId,boolean invalidate){
  try {
    doDeleteSession(sessionId,invalidate);
    return true;
  }
 catch (  Exception e) {
    orphanSessions.add(new AbstractMap.SimpleEntry(sessionId,invalidate));
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Delete session.
 * @param sessionId  sessionId
 * @param invalidate if true remove the distributed session, otherwise justremove the jvm reference
 * @return the boolean
 */
public boolean deleteSession(String sessionId,boolean invalidate){
  try {
    doDeleteSession(sessionId,invalidate);
    return true;
  }
 catch (  Exception e) {
    orphanSessions.add(new AbstractMap.SimpleEntry(sessionId,invalidate));
    return false;
  }
}
Program: 46853
Project: 46853
Buggy source:
/** 
 * Sets attribute.
 * @param sessionId the session id
 * @param attributeName the attribute name
 * @param value the value
 * @throws Exception the exception
 */
void setAttribute(String sessionId,String attributeName,Object value) throws Exception {
  Data dataValue=(value == null) ? null : sss.getSerializationService().toData(value);
  SessionUpdateEntryProcessor sessionUpdateProcessor=new SessionUpdateEntryProcessor(attributeName,dataValue);
  sessionUpdateProcessor.setJvmId(jvmId);
  executeOnKey(sessionId,sessionUpdateProcessor);
}

Fixed version (ground truth):
/** 
 * Sets attribute.
 * @param sessionId     the session id
 * @param attributeName the attribute name
 * @param value         the value
 * @throws Exception the exception
 */
void setAttribute(String sessionId,String attributeName,Object value) throws Exception {
  Data dataValue=(value == null) ? null : sss.getSerializationService().toData(value);
  SessionUpdateEntryProcessor sessionUpdateProcessor=new SessionUpdateEntryProcessor(attributeName,dataValue);
  sessionUpdateProcessor.setJvmId(jvmId);
  executeOnKey(sessionId,sessionUpdateProcessor);
}
Program: 46854
Project: 46854
Buggy source:
/** 
 * Gets attribute.
 * @param sessionId the session id
 * @param attributeName the attribute name
 * @return the attribute
 * @throws Exception the exception
 */
Object getAttribute(String sessionId,String attributeName) throws Exception {
  GetAttributeEntryProcessor entryProcessor=new GetAttributeEntryProcessor(attributeName);
  entryProcessor.setJvmId(jvmId);
  return executeOnKey(sessionId,entryProcessor);
}

Fixed version (ground truth):
/** 
 * Gets attribute.
 * @param sessionId     the session id
 * @param attributeName the attribute name
 * @return the attribute
 * @throws Exception the exception
 */
Object getAttribute(String sessionId,String attributeName) throws Exception {
  GetAttributeEntryProcessor entryProcessor=new GetAttributeEntryProcessor(attributeName);
  entryProcessor.setJvmId(jvmId);
  return executeOnKey(sessionId,entryProcessor);
}
Program: 46855
Project: 46855
Buggy source:
private void ensureInstance() throws Exception {
  if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
synchronized (this) {
      try {
        if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
          reconnectHZInstansce();
          clearOrphanSessionQueue();
        }
      }
 catch (      Exception e) {
        failedConnection=true;
        throw e;
      }
    }
  }
}

Fixed version (ground truth):
private void ensureInstance() throws Exception {
  if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
synchronized (this) {
      try {
        if (failedConnection && System.currentTimeMillis() > lastConnectionTry + RETRY_MILLIS) {
          reconnectHZInstance();
          clearOrphanSessionQueue();
        }
      }
 catch (      Exception e) {
        setFailedConnection(true);
        if (LOGGER.isFinestEnabled()) {
          LOGGER.finest("String_Node_Str",e);
        }
      }
    }
  }
}
Program: 46856
Project: 46856
Buggy source:
/** 
 * Delete attribute.
 * @param sessionId the session id
 * @param attributeName the attribute name
 * @throws Exception the exception
 */
void deleteAttribute(String sessionId,String attributeName) throws Exception {
  setAttribute(sessionId,attributeName,null);
}

Fixed version (ground truth):
/** 
 * Delete attribute.
 * @param sessionId     the session id
 * @param attributeName the attribute name
 * @throws Exception the exception
 */
void deleteAttribute(String sessionId,String attributeName) throws Exception {
  setAttribute(sessionId,attributeName,null);
}