nus-yam/ex-repair huggingface dataset:
Program: 46697
Project: 46697
Buggy source:
public Object getAndRemove(Data key,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  deleteCacheEntry(key);
  R record=records.get(key);
  final Object obj;
  boolean removed=false;
  try {
    if (recordNotExistOrExpired(record,now)) {
      obj=null;
      if (isEventsEnabled()) {
        publishEvent(createCacheCompleteEvent(toEventData(key),CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin,completionId));
      }
    }
 else {
      obj=toValue(record);
      removed=deleteRecord(key,completionId,source,origin);
    }
    onRemove(key,null,source,false,record,removed);
    if (isStatisticsEnabled()) {
      statistics.addGetTimeNanos(System.nanoTime() - start);
      if (obj != null) {
        statistics.increaseCacheHits(1);
        statistics.increaseCacheRemovals(1);
        statistics.addRemoveTimeNanos(System.nanoTime() - start);
      }
 else {
        statistics.increaseCacheMisses(1);
      }
    }
    return obj;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
public Object getAndRemove(Data key,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=isStatisticsEnabled() ? System.nanoTime() : 0;
  deleteCacheEntry(key);
  R record=records.get(key);
  final Object obj;
  boolean removed=false;
  try {
    if (recordNotExistOrExpired(record,now)) {
      obj=null;
      if (isEventsEnabled()) {
        publishEvent(createCacheCompleteEvent(toEventData(key),CacheRecord.TIME_NOT_AVAILABLE,origin,completionId));
      }
    }
 else {
      obj=toValue(record);
      removed=deleteRecord(key,completionId,source,origin);
    }
    onRemove(key,null,source,false,record,removed);
    if (isStatisticsEnabled()) {
      statistics.addGetTimeNanos(System.nanoTime() - start);
      if (obj != null) {
        statistics.increaseCacheHits(1);
        statistics.increaseCacheRemovals(1);
        statistics.addRemoveTimeNanos(System.nanoTime() - start);
      }
 else {
        statistics.increaseCacheMisses(1);
      }
    }
    return obj;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 46698
Project: 46698
Buggy source:
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  int hitCount=0;
  boolean removed=false;
  try {
    if (recordNotExistOrExpired(record,now)) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
      }
    }
    if (!removed) {
      if (isEventsEnabled()) {
        publishEvent(createCacheCompleteEvent(toEventData(key),CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin,completionId));
      }
    }
    onRemove(key,value,source,false,record,removed);
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}

Fixed version (ground truth):
public boolean remove(Data key,Object value,String source,int completionId,String origin){
  final long now=Clock.currentTimeMillis();
  final long start=System.nanoTime();
  R record=records.get(key);
  int hitCount=0;
  boolean removed=false;
  try {
    if (recordNotExistOrExpired(record,now)) {
      if (isStatisticsEnabled()) {
        statistics.increaseCacheMisses(1);
      }
    }
 else {
      hitCount++;
      if (compare(toStorageValue(record),toStorageValue(value))) {
        deleteCacheEntry(key);
        removed=deleteRecord(key,completionId,source,origin);
      }
 else {
        long expiryTime=onRecordAccess(key,record,defaultExpiryPolicy,now);
        processExpiredEntry(key,record,expiryTime,now,source,origin);
      }
    }
    if (!removed) {
      if (isEventsEnabled()) {
        publishEvent(createCacheCompleteEvent(toEventData(key),CacheRecord.TIME_NOT_AVAILABLE,origin,completionId));
      }
    }
    onRemove(key,value,source,false,record,removed);
    updateRemoveStatistics(removed,hitCount,start);
    return removed;
  }
 catch (  Throwable error) {
    onRemoveError(key,null,source,false,record,removed,error);
    throw ExceptionUtil.rethrow(error);
  }
}
Program: 46699
Project: 46699
Buggy source:
protected boolean updateRecordWithExpiry(Data key,Object value,R record,ExpiryPolicy expiryPolicy,long now,boolean disableWriteThrough,int completionId,String source,String origin){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  long expiryTime=CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE;
  try {
    Duration expiryDuration=expiryPolicy.getExpiryForUpdate();
    if (expiryDuration != null) {
      expiryTime=expiryDuration.getAdjustedTime(now);
    }
  }
 catch (  Exception e) {
    EmptyStatement.ignore(e);
  }
  return updateRecordWithExpiry(key,value,record,expiryTime,now,disableWriteThrough,completionId,source,origin);
}

Fixed version (ground truth):
protected boolean updateRecordWithExpiry(Data key,Object value,R record,ExpiryPolicy expiryPolicy,long now,boolean disableWriteThrough,int completionId,String source,String origin){
  expiryPolicy=getExpiryPolicy(expiryPolicy);
  long expiryTime=CacheRecord.TIME_NOT_AVAILABLE;
  try {
    Duration expiryDuration=expiryPolicy.getExpiryForUpdate();
    if (expiryDuration != null) {
      expiryTime=expiryDuration.getAdjustedTime(now);
    }
  }
 catch (  Exception e) {
    EmptyStatement.ignore(e);
  }
  return updateRecordWithExpiry(key,value,record,expiryTime,now,disableWriteThrough,completionId,source,origin);
}
Program: 46700
Project: 46700
Buggy source:
protected R processExpiredEntry(Data key,R record,long expiryTime,long now,String source,String origin){
  final boolean isExpired=isExpiredAt(expiryTime,now);
  if (!isExpired) {
    return record;
  }
  if (isStatisticsEnabled()) {
    statistics.increaseCacheExpiries(1);
  }
  R removedRecord=doRemoveRecord(key,source);
  Data keyEventData=toEventData(key);
  Data recordEventData=toEventData(removedRecord);
  onProcessExpiredEntry(key,removedRecord,expiryTime,now,source,origin);
  if (isEventsEnabled()) {
    publishEvent(createCacheExpiredEvent(keyEventData,recordEventData,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin,IGNORE_COMPLETION));
  }
  return null;
}

Fixed version (ground truth):
protected R processExpiredEntry(Data key,R record,long expiryTime,long now,String source,String origin){
  final boolean isExpired=isExpiredAt(expiryTime,now);
  if (!isExpired) {
    return record;
  }
  if (isStatisticsEnabled()) {
    statistics.increaseCacheExpiries(1);
  }
  R removedRecord=doRemoveRecord(key,source);
  Data keyEventData=toEventData(key);
  Data recordEventData=toEventData(removedRecord);
  onProcessExpiredEntry(key,removedRecord,expiryTime,now,source,origin);
  if (isEventsEnabled()) {
    publishEvent(createCacheExpiredEvent(keyEventData,recordEventData,CacheRecord.TIME_NOT_AVAILABLE,origin,IGNORE_COMPLETION));
  }
  return null;
}
Program: 46701
Project: 46701
Buggy source:
protected boolean deleteRecord(Data key,int completionId,String source,String origin){
  final R record=doRemoveRecord(key,source);
  Data dataValue=null;
  try {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
case OBJECT:
case NATIVE:
      dataValue=toData(record);
    break;
default :
  throw new IllegalArgumentException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
Data eventDataKey=toEventData(key);
Data eventDataValue=toEventData(dataValue);
onDeleteRecord(key,record,dataValue,record != null);
if (isEventsEnabled()) {
publishEvent(createCacheRemovedEvent(eventDataKey,eventDataValue,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,origin,completionId));
}
return record != null;
}
 catch (Throwable error) {
onDeleteRecordError(key,record,dataValue,record != null,error);
throw ExceptionUtil.rethrow(error);
}
}

Fixed version (ground truth):
protected boolean deleteRecord(Data key,int completionId,String source,String origin){
  final R record=doRemoveRecord(key,source);
  Data dataValue=null;
  try {
switch (cacheConfig.getInMemoryFormat()) {
case BINARY:
case OBJECT:
case NATIVE:
      dataValue=toData(record);
    break;
default :
  throw new IllegalArgumentException("String_Node_Str" + cacheConfig.getInMemoryFormat());
}
Data eventDataKey=toEventData(key);
Data eventDataValue=toEventData(dataValue);
onDeleteRecord(key,record,dataValue,record != null);
if (isEventsEnabled()) {
publishEvent(createCacheRemovedEvent(eventDataKey,eventDataValue,CacheRecord.TIME_NOT_AVAILABLE,origin,completionId));
}
return record != null;
}
 catch (Throwable error) {
onDeleteRecordError(key,record,dataValue,record != null,error);
throw ExceptionUtil.rethrow(error);
}
}
Program: 46702
Project: 46702
Buggy source:
public static CacheEventContext createCacheRemovedEvent(Data dataKey){
  return createCacheRemovedEvent(dataKey,null,CacheRecord.EXPIRATION_TIME_NOT_AVAILABLE,null,MutableOperation.IGNORE_COMPLETION);
}

Fixed version (ground truth):
public static CacheEventContext createCacheRemovedEvent(Data dataKey){
  return createCacheRemovedEvent(dataKey,null,CacheRecord.TIME_NOT_AVAILABLE,null,MutableOperation.IGNORE_COMPLETION);
}
Program: 46703
Project: 46703
Buggy source:
@Override public boolean isExpiredAt(long now){
  return expirationTime > -1 && expirationTime <= now;
}

Fixed version (ground truth):
@Override public boolean isExpiredAt(long now){
  return expirationTime > TIME_NOT_AVAILABLE && expirationTime <= now;
}
Program: 46704
Project: 46704
Buggy source:
private IMap<Integer,SampleObject> createInstanceAndGetMap(){
  String name=randomString();
  Config config=new Config();
  MapConfig mapConfig=config.getMapConfig(name);
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  mapStoreConfig.setEnabled(true).setClassName(IncrementerPostProcessingMapStore.class.getName());
  mapConfig.setMapStoreConfig(mapStoreConfig);
  HazelcastInstance instance=createHazelcastInstance(config);
  return instance.getMap(name);
}

Fixed version (ground truth):
private IMap<Integer,SampleObject> createInstanceAndGetMap(){
  String name=randomString();
  Config config=new Config();
  MapConfig mapConfig=config.getMapConfig(name);
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  mapStoreConfig.setEnabled(true).setClassName(IncrementerPostProcessingMapStore.class.getName());
  mapConfig.setMapStoreConfig(mapStoreConfig);
  HazelcastInstance instance=factory.newHazelcastInstance(config);
  warmUpPartitions(instance);
  return instance.getMap(name);
}
Program: 46705
Project: 46705
Buggy source:
@Test public void testProcessedValueCarriedToTheBackup(){
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  String name=randomString();
  Config config=new Config();
  MapConfig mapConfig=config.getMapConfig(name);
  mapConfig.setReadBackupData(true);
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  mapStoreConfig.setEnabled(true).setClassName(IncrementerPostProcessingMapStore.class.getName());
  mapConfig.setMapStoreConfig(mapStoreConfig);
  HazelcastInstance instance1=factory.newHazelcastInstance(config);
  HazelcastInstance instance2=factory.newHazelcastInstance(config);
  IMap<Integer,SampleObject> map1=instance1.getMap(name);
  IMap<Integer,SampleObject> map2=instance2.getMap(name);
  for (int i=0; i < 100; i++) {
    map1.put(i,new SampleObject(i));
  }
  for (int i=0; i < 100; i++) {
    SampleObject o=map1.get(i);
    assertEquals(i + 1,o.version);
  }
  for (int i=0; i < 100; i++) {
    SampleObject o=map2.get(i);
    assertEquals(i + 1,o.version);
  }
}

Fixed version (ground truth):
@Test public void testProcessedValueCarriedToTheBackup(){
  String name=randomString();
  Config config=new Config();
  MapConfig mapConfig=config.getMapConfig(name);
  mapConfig.setReadBackupData(true);
  MapStoreConfig mapStoreConfig=new MapStoreConfig();
  mapStoreConfig.setEnabled(true).setClassName(IncrementerPostProcessingMapStore.class.getName());
  mapConfig.setMapStoreConfig(mapStoreConfig);
  HazelcastInstance instance1=factory.newHazelcastInstance(config);
  HazelcastInstance instance2=factory.newHazelcastInstance(config);
  IMap<Integer,SampleObject> map1=instance1.getMap(name);
  IMap<Integer,SampleObject> map2=instance2.getMap(name);
  for (int i=0; i < 100; i++) {
    map1.put(i,new SampleObject(i));
  }
  for (int i=0; i < 100; i++) {
    SampleObject o=map1.get(i);
    assertEquals(i + 1,o.version);
  }
  for (int i=0; i < 100; i++) {
    SampleObject o=map2.get(i);
    assertEquals(i + 1,o.version);
  }
}
Program: 46706
Project: 46706
Buggy source:
void initialClusterState(ClusterState initialState){
  clusterServiceLock.lock();
  try {
    final ClusterState currentState=getState();
    if (currentState != ClusterState.ACTIVE && currentState != initialState) {
      logger.warning("String_Node_Str" + "String_Node_Str" + currentState + "String_Node_Str"+ initialState);
      return;
    }
    this.state=initialState;
    changeNodeState(initialState);
    node.getNodeExtension().onClusterStateChange(initialState);
  }
  finally {
    clusterServiceLock.unlock();
  }
}

Fixed version (ground truth):
void initialClusterState(ClusterState initialState){
  clusterServiceLock.lock();
  try {
    final ClusterState currentState=getState();
    if (currentState != ClusterState.ACTIVE && currentState != initialState) {
      logger.warning("String_Node_Str" + "String_Node_Str" + currentState + "String_Node_Str"+ initialState);
      return;
    }
    this.state=initialState;
    changeNodeState(initialState);
    node.getNodeExtension().onClusterStateChange(initialState,false);
  }
  finally {
    clusterServiceLock.unlock();
  }
}
Program: 46707
Project: 46707
Buggy source:
public void commitClusterState(ClusterState newState,Address initiator,String txnId){
  Preconditions.checkNotNull(newState);
  if (newState == ClusterState.IN_TRANSITION) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  clusterServiceLock.lock();
  try {
    final ClusterStateLock stateLock=getStateLock();
    if (!stateLock.allowsUnlock(txnId)) {
      throw new TransactionException("String_Node_Str" + state + "String_Node_Str"+ newState+ "String_Node_Str"+ initiator+ "String_Node_Str"+ stateToString());
    }
    this.state=newState;
    stateLockRef.set(ClusterStateLock.NOT_LOCKED);
    changeNodeState(newState);
    node.getNodeExtension().onClusterStateChange(newState);
    if (newState == ClusterState.ACTIVE) {
      node.getClusterService().removeMembersDeadWhileClusterIsNotActive();
    }
  }
  finally {
    clusterServiceLock.unlock();
  }
}

Fixed version (ground truth):
public void commitClusterState(ClusterState newState,Address initiator,String txnId){
  Preconditions.checkNotNull(newState);
  if (newState == ClusterState.IN_TRANSITION) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  clusterServiceLock.lock();
  try {
    final ClusterStateLock stateLock=getStateLock();
    if (!stateLock.allowsUnlock(txnId)) {
      throw new TransactionException("String_Node_Str" + state + "String_Node_Str"+ newState+ "String_Node_Str"+ initiator+ "String_Node_Str"+ stateToString());
    }
    this.state=newState;
    stateLockRef.set(ClusterStateLock.NOT_LOCKED);
    changeNodeState(newState);
    node.getNodeExtension().onClusterStateChange(newState,true);
    if (newState == ClusterState.ACTIVE) {
      node.getClusterService().removeMembersDeadWhileClusterIsNotActive();
    }
  }
  finally {
    clusterServiceLock.unlock();
  }
}
Program: 46708
Project: 46708
Buggy source:
void setClusterState(ClusterState newState){
  clusterServiceLock.lock();
  try {
    this.state=newState;
    stateLockRef.set(ClusterStateLock.NOT_LOCKED);
    changeNodeState(newState);
    node.getNodeExtension().onClusterStateChange(newState);
  }
  finally {
    clusterServiceLock.unlock();
  }
}

Fixed version (ground truth):
void setClusterState(ClusterState newState,boolean persistentChange){
  clusterServiceLock.lock();
  try {
    this.state=newState;
    stateLockRef.set(ClusterStateLock.NOT_LOCKED);
    changeNodeState(newState);
    node.getNodeExtension().onClusterStateChange(newState,persistentChange);
  }
  finally {
    clusterServiceLock.unlock();
  }
}
Program: 46709
Project: 46709
Buggy source:
@Override public void onClusterStateChange(ClusterState newState){
}

Fixed version (ground truth):
@Override public void onClusterStateChange(ClusterState newState,boolean persistentChange){
}
Program: 46710
Project: 46710
Buggy source:
/** 
 * Called when cluster state is changed
 * @param newState new state
 */
void onClusterStateChange(ClusterState newState);

Fixed version (ground truth):
/** 
 * Called when cluster state is changed
 * @param newState new state
 * @param persistentChange status of the change. A cluster state change may be non-persistent if it has been done temporarilyduring system operations such cluster start etc.
 */
void onClusterStateChange(ClusterState newState,boolean persistentChange);
Program: 46711
Project: 46711
Buggy source:
private void reconnectHZInstance() throws ServletException {
  LOGGER.info("String_Node_Str");
  lastConnectionTry=System.currentTimeMillis();
  hazelcastInstance=HazelcastInstanceLoader.createInstance(this,filterConfig,properties);
  clusterMap=hazelcastInstance.getMap(clusterMapName);
  sss=(SerializationServiceSupport)hazelcastInstance;
  setFailedConnection(false);
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
private void reconnectHZInstance() throws ServletException {
  LOGGER.info("String_Node_Str");
  lastConnectionTry=System.currentTimeMillis();
  hazelcastInstance=HazelcastInstanceLoader.createInstance(this,filterConfig,properties,clusterMapName);
  clusterMap=hazelcastInstance.getMap(clusterMapName);
  sss=(SerializationServiceSupport)hazelcastInstance;
  setFailedConnection(false);
  LOGGER.info("String_Node_Str");
}
Program: 46712
Project: 46712
Buggy source:
/** 
 * Gets attributes.
 * @param sessionId the session id
 * @return the attributes
 * @throws Exception the exception
 */
Set<Map.Entry<String,Object>> getAttributes(String sessionId) throws Exception {
  GetSessionStateEntryProcessor entryProcessor=new GetSessionStateEntryProcessor();
  entryProcessor.setJvmId(jvmId);
  SessionState sessionState=(SessionState)executeOnKey(sessionId,entryProcessor);
  if (sessionState == null) {
    return null;
  }
  Map<String,Data> dataAttributes=sessionState.getAttributes();
  Set<Map.Entry<String,Object>> attributes=new HashSet<Map.Entry<String,Object>>(dataAttributes.size());
  for (  Map.Entry<String,Data> entry : dataAttributes.entrySet()) {
    String key=entry.getKey();
    Object value=sss.getSerializationService().toObject(entry.getValue());
    attributes.add(new MapEntrySimple<String,Object>(key,value));
  }
  return attributes;
}

Fixed version (ground truth):
/** 
 * Gets attributes.
 * @param sessionId the session id
 * @return the attributes
 * @throws Exception the exception
 */
Set<Map.Entry<String,Object>> getAttributes(String sessionId) throws Exception {
  GetSessionStateEntryProcessor entryProcessor=new GetSessionStateEntryProcessor();
  SessionState sessionState=(SessionState)executeOnKey(sessionId,entryProcessor);
  if (sessionState == null) {
    return null;
  }
  Map<String,Data> dataAttributes=sessionState.getAttributes();
  Set<Map.Entry<String,Object>> attributes=new HashSet<Map.Entry<String,Object>>(dataAttributes.size());
  for (  Map.Entry<String,Data> entry : dataAttributes.entrySet()) {
    String key=entry.getKey();
    Object value=sss.getSerializationService().toObject(entry.getValue());
    attributes.add(new MapEntrySimple<String,Object>(key,value));
  }
  return attributes;
}
Program: 46713
Project: 46713
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());
  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: 46714
Project: 46714
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);
  executeOnKey(sessionId,sessionUpdateProcessor);
}
Program: 46715
Project: 46715
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);
  return executeOnKey(sessionId,entryProcessor);
}
Program: 46716
Project: 46716
Buggy source:
/** 
 * 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;
  }
}

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 {
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    LOGGER.finest("String_Node_Str",e);
    throw e;
  }
}
Program: 46717
Project: 46717
Buggy source:
private void doDeleteSession(String sessionId,boolean invalidate) throws Exception {
  DeleteSessionEntryProcessor entryProcessor=new DeleteSessionEntryProcessor(sessionId,invalidate);
  entryProcessor.setJvmId(jvmId);
  executeOnKey(sessionId,entryProcessor);
}

Fixed version (ground truth):
private void doDeleteSession(String sessionId,boolean invalidate) throws Exception {
  DeleteSessionEntryProcessor entryProcessor=new DeleteSessionEntryProcessor(invalidate);
  executeOnKey(sessionId,entryProcessor);
}
Program: 46718
Project: 46718
Buggy source:
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,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);
}

Fixed version (ground truth):
public static HazelcastInstance createInstance(final ClusteredSessionService sessionService,final FilterConfig filterConfig,final Properties properties,final String mapName) 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);
  }
  String sessionTTLConfig=properties.getProperty(SESSION_TTL_CONFIG);
  if (useClient) {
    if (sessionTTLConfig != null) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    boolean isSticky=Boolean.valueOf(properties.getProperty(STICKY_SESSION_CONFIG));
    return createClientInstance(sessionService,configUrl,isSticky);
  }
  Config config=getServerConfig(mapName,configUrl,sessionTTLConfig);
  return createHazelcastInstance(sessionService,instanceName,config);
}
Program: 46719
Project: 46719
Buggy source:
@Override public void readData(ObjectDataInput in) throws IOException {
  int jvmCount=in.readInt();
  for (int i=0; i < jvmCount; i++) {
    jvmIds.add(in.readUTF());
  }
  int attCount=in.readInt();
  for (int i=0; i < attCount; i++) {
    attributes.put(in.readUTF(),in.readData());
  }
}

Fixed version (ground truth):
@Override public void readData(ObjectDataInput in) throws IOException {
  int attCount=in.readInt();
  for (int i=0; i < attCount; i++) {
    attributes.put(in.readUTF(),in.readData());
  }
}
Program: 46720
Project: 46720
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str" + jvmIds.size());
  sb.append("String_Node_Str" + ((attributes == null) ? 0 : attributes.size()));
  if (attributes != null) {
    for (    Map.Entry<String,Data> entry : attributes.entrySet()) {
      Data data=entry.getValue();
      int len=(data == null) ? 0 : data.dataSize();
      sb.append("String_Node_Str");
      sb.append(entry.getKey() + "String_Node_Str" + len+ "String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append("String_Node_Str" + ((attributes == null) ? 0 : attributes.size()));
  if (attributes != null) {
    for (    Map.Entry<String,Data> entry : attributes.entrySet()) {
      Data data=entry.getValue();
      int len=(data == null) ? 0 : data.dataSize();
      sb.append("String_Node_Str");
      sb.append(entry.getKey() + "String_Node_Str" + len+ "String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 46721
Project: 46721
Buggy source:
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeInt(jvmIds.size());
  for (  String jvmId : jvmIds) {
    out.writeUTF(jvmId);
  }
  out.writeInt(attributes.size());
  for (  Map.Entry<String,Data> entry : attributes.entrySet()) {
    out.writeUTF(entry.getKey());
    out.writeData(entry.getValue());
  }
}

Fixed version (ground truth):
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeInt(attributes.size());
  for (  Map.Entry<String,Data> entry : attributes.entrySet()) {
    out.writeUTF(entry.getKey());
    out.writeData(entry.getValue());
  }
}
Program: 46722
Project: 46722
Buggy source:
public final void doFilter(ServletRequest req,ServletResponse res,final FilterChain chain) throws IOException, ServletException {
  if (!(req instanceof HttpServletRequest)) {
    chain.doFilter(req,res);
  }
 else {
    if (req instanceof RequestWrapper) {
      LOGGER.finest("String_Node_Str");
      chain.doFilter(req,res);
      return;
    }
    HttpServletRequest httpReq=(HttpServletRequest)req;
    RequestWrapper existingReq=(RequestWrapper)req.getAttribute(HAZELCAST_REQUEST);
    final ResponseWrapper resWrapper=new ResponseWrapper((HttpServletResponse)res);
    final RequestWrapper reqWrapper=new RequestWrapper(httpReq,resWrapper);
    if (existingReq != null) {
      reqWrapper.setHazelcastSession(existingReq.hazelcastSession,existingReq.clusteredSessionId);
    }
    chain.doFilter(reqWrapper,resWrapper);
    if (existingReq != null) {
      return;
    }
    HazelcastHttpSession session=reqWrapper.getSession(false);
    if (session != null && session.isValid()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + session.getId());
      }
      if (deferredWrite) {
        session.sessionDeferredWrite();
      }
    }
  }
}

Fixed version (ground truth):
@Override public final void doFilter(ServletRequest req,ServletResponse res,final FilterChain chain) throws IOException, ServletException {
  if (!(req instanceof HttpServletRequest)) {
    chain.doFilter(req,res);
  }
 else {
    if (req instanceof RequestWrapper) {
      LOGGER.finest("String_Node_Str");
      chain.doFilter(req,res);
      return;
    }
    HttpServletRequest httpReq=(HttpServletRequest)req;
    RequestWrapper existingReq=(RequestWrapper)req.getAttribute(HAZELCAST_REQUEST);
    final ResponseWrapper resWrapper=new ResponseWrapper((HttpServletResponse)res);
    final RequestWrapper reqWrapper=new RequestWrapper(httpReq,resWrapper);
    if (existingReq != null) {
      reqWrapper.setHazelcastSession(existingReq.hazelcastSession,existingReq.clusteredSessionId);
    }
    chain.doFilter(reqWrapper,resWrapper);
    if (existingReq != null) {
      return;
    }
    HazelcastHttpSession session=reqWrapper.getSession(false);
    if (session != null && session.isValid()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + session.getId());
      }
      if (deferredWrite) {
        session.sessionDeferredWrite();
      }
    }
  }
}
Program: 46723
Project: 46723
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);
  setProperty(HazelcastInstanceLoader.STICKY_SESSION_CONFIG);
}

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);
  setProperty(HazelcastInstanceLoader.SESSION_TTL_CONFIG);
}
Program: 46724
Project: 46724
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();
  }
  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);
  }
}

Fixed version (ground truth):
@Override 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: 46725
Project: 46725
Buggy source:
public final void destroy(){
  sessions.clear();
  originalSessions.clear();
  if (shutdownOnDestroy) {
    clusteredSessionService.destroy();
  }
}

Fixed version (ground truth):
@Override public final void destroy(){
  sessions.clear();
  originalSessions.clear();
  if (shutdownOnDestroy) {
    clusteredSessionService.destroy();
  }
}
Program: 46726
Project: 46726
Buggy source:
@Override public Object process(Map.Entry<String,SessionState> entry){
  SessionState sessionState=entry.getValue();
  if (sessionState == null) {
    return Boolean.FALSE;
  }
  sessionState.removeJvmId(jvmId);
  if (invalidate || sessionState.getJvmIds().isEmpty()) {
    entry.setValue(null);
    removed=true;
  }
 else {
    entry.setValue(sessionState);
  }
  return Boolean.TRUE;
}

Fixed version (ground truth):
@Override public Object process(Map.Entry<String,SessionState> entry){
  SessionState sessionState=entry.getValue();
  if (sessionState == null) {
    return Boolean.FALSE;
  }
  if (invalidate) {
    entry.setValue(null);
    removed=true;
  }
 else {
    entry.setValue(sessionState);
  }
  return Boolean.TRUE;
}
Program: 46727
Project: 46727
Buggy source:
@Override public void readData(ObjectDataInput in) throws IOException {
  jvmId=in.readUTF();
  invalidate=in.readBoolean();
}

Fixed version (ground truth):
@Override public void readData(ObjectDataInput in) throws IOException {
  invalidate=in.readBoolean();
}
Program: 46728
Project: 46728
Buggy source:
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeUTF(jvmId);
  out.writeBoolean(invalidate);
}

Fixed version (ground truth):
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeBoolean(invalidate);
}
Program: 46729
Project: 46729
Buggy source:
private void reconnectHZInstance() throws ServletException {
  LOGGER.info("String_Node_Str");
  lastConnectionTry=System.currentTimeMillis();
  hazelcastInstance=HazelcastInstanceLoader.createInstance(this,filterConfig,properties);
  clusterMap=hazelcastInstance.getMap(clusterMapName);
  sss=(SerializationServiceSupport)hazelcastInstance;
  setFailedConnection(false);
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
private void reconnectHZInstance() throws ServletException {
  LOGGER.info("String_Node_Str");
  lastConnectionTry=System.currentTimeMillis();
  hazelcastInstance=HazelcastInstanceLoader.createInstance(this,filterConfig,properties,clusterMapName);
  clusterMap=hazelcastInstance.getMap(clusterMapName);
  sss=(SerializationServiceSupport)hazelcastInstance;
  setFailedConnection(false);
  LOGGER.info("String_Node_Str");
}
Program: 46730
Project: 46730
Buggy source:
/** 
 * Gets attributes.
 * @param sessionId the session id
 * @return the attributes
 * @throws Exception the exception
 */
Set<Map.Entry<String,Object>> getAttributes(String sessionId) throws Exception {
  GetSessionStateEntryProcessor entryProcessor=new GetSessionStateEntryProcessor();
  entryProcessor.setJvmId(jvmId);
  SessionState sessionState=(SessionState)executeOnKey(sessionId,entryProcessor);
  if (sessionState == null) {
    return null;
  }
  Map<String,Data> dataAttributes=sessionState.getAttributes();
  Set<Map.Entry<String,Object>> attributes=new HashSet<Map.Entry<String,Object>>(dataAttributes.size());
  for (  Map.Entry<String,Data> entry : dataAttributes.entrySet()) {
    String key=entry.getKey();
    Object value=sss.getSerializationService().toObject(entry.getValue());
    attributes.add(new MapEntrySimple<String,Object>(key,value));
  }
  return attributes;
}

Fixed version (ground truth):
/** 
 * Gets attributes.
 * @param sessionId the session id
 * @return the attributes
 * @throws Exception the exception
 */
Set<Map.Entry<String,Object>> getAttributes(String sessionId) throws Exception {
  GetSessionStateEntryProcessor entryProcessor=new GetSessionStateEntryProcessor();
  SessionState sessionState=(SessionState)executeOnKey(sessionId,entryProcessor);
  if (sessionState == null) {
    return null;
  }
  Map<String,Data> dataAttributes=sessionState.getAttributes();
  Set<Map.Entry<String,Object>> attributes=new HashSet<Map.Entry<String,Object>>(dataAttributes.size());
  for (  Map.Entry<String,Data> entry : dataAttributes.entrySet()) {
    String key=entry.getKey();
    Object value=sss.getSerializationService().toObject(entry.getValue());
    attributes.add(new MapEntrySimple<String,Object>(key,value));
  }
  return attributes;
}
Program: 46731
Project: 46731
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());
  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: 46732
Project: 46732
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);
  executeOnKey(sessionId,sessionUpdateProcessor);
}
Program: 46733
Project: 46733
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);
  return executeOnKey(sessionId,entryProcessor);
}
Program: 46734
Project: 46734
Buggy source:
/** 
 * 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;
  }
}

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 {
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    LOGGER.finest("String_Node_Str",e);
    throw e;
  }
}
Program: 46735
Project: 46735
Buggy source:
private void doDeleteSession(String sessionId,boolean invalidate) throws Exception {
  DeleteSessionEntryProcessor entryProcessor=new DeleteSessionEntryProcessor(sessionId,invalidate);
  entryProcessor.setJvmId(jvmId);
  executeOnKey(sessionId,entryProcessor);
}

Fixed version (ground truth):
private void doDeleteSession(String sessionId,boolean invalidate) throws Exception {
  DeleteSessionEntryProcessor entryProcessor=new DeleteSessionEntryProcessor(invalidate);
  executeOnKey(sessionId,entryProcessor);
}
Program: 46736
Project: 46736
Buggy source:
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);
}

Fixed version (ground truth):
public static HazelcastInstance createInstance(final ClusteredSessionService sessionService,final FilterConfig filterConfig,final Properties properties,final String mapName) 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);
  }
  String sessionTTLConfig=properties.getProperty(SESSION_TTL_CONFIG);
  if (useClient) {
    if (sessionTTLConfig != null) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    boolean isSticky=Boolean.valueOf(properties.getProperty(STICKY_SESSION_CONFIG));
    return createClientInstance(sessionService,configUrl,isSticky);
  }
  Config config=getServerConfig(mapName,configUrl,sessionTTLConfig);
  return createHazelcastInstance(sessionService,instanceName,config);
}
Program: 46737
Project: 46737
Buggy source:
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);
}

Fixed version (ground truth):
private static HazelcastInstance createClientInstance(ClusteredSessionService sessionService,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);
    }
  }
  if (isSticky) {
    clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
  }
  ListenerConfig listenerConfig=new ListenerConfig(new ClientLifecycleListener(sessionService));
  clientConfig.addListenerConfig(listenerConfig);
  return HazelcastClient.newHazelcastClient(clientConfig);
}