nus-yam/ex-repair huggingface dataset:
Program: 46150
Project: 46150
Buggy source:
private Object putInternalAsync(final V value,final boolean isGet,final long start,final Data keyData,final Data valueData,ClientInvocationFuture future,final boolean marked){
  OneShotExecutionCallback<V> oneShotExecutionCallback=null;
  if (nearCache != null || statisticsEnabled) {
    oneShotExecutionCallback=new OneShotExecutionCallback<V>(){
      @Override protected void onResponseInternal(      V responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,marked);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          handleStatisticsOnPut(isGet,start,responseData);
        }
      }
      @Override protected void onFailureInternal(      Throwable t){
        if (nearCache != null && cacheOnUpdate) {
          resetToUnmarkedState(keyData);
        }
      }
    }
;
  }
  SerializationService serializationService=clientContext.getSerializationService();
  if (oneShotExecutionCallback == null) {
    return new ClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER);
  }
  ClientDelegatingFuture<V> delegatingFuture=new CallbackAwareClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER,oneShotExecutionCallback);
  delegatingFuture.andThen(oneShotExecutionCallback);
  return delegatingFuture;
}

Fixed version (ground truth):
private Object putInternalAsync(final V value,final boolean isGet,final long start,final Data keyData,final Data valueData,ClientInvocationFuture future){
  OneShotExecutionCallback<V> oneShotExecutionCallback=null;
  if (nearCache != null || statisticsEnabled) {
    oneShotExecutionCallback=new OneShotExecutionCallback<V>(){
      @Override protected void onResponseInternal(      V responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          handleStatisticsOnPut(isGet,start,responseData);
        }
      }
      @Override protected void onFailureInternal(      Throwable t){
      }
    }
;
  }
  SerializationService serializationService=clientContext.getSerializationService();
  if (oneShotExecutionCallback == null) {
    return new ClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER);
  }
  ClientDelegatingFuture<V> delegatingFuture=new CallbackAwareClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER,oneShotExecutionCallback);
  delegatingFuture.andThen(oneShotExecutionCallback);
  return delegatingFuture;
}
Program: 46151
Project: 46151
Buggy source:
@Override public void onResponse(Boolean responseData){
  if (nearCache != null) {
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value,marked);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
  if (statisticsEnabled) {
    Object response=clientContext.getSerializationService().toObject(responseData);
    handleStatisticsOnPutIfAbsent(start,(Boolean)response);
  }
}

Fixed version (ground truth):
@Override public void onResponse(Boolean responseData){
  if (nearCache != null) {
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
  if (statisticsEnabled) {
    Object response=clientContext.getSerializationService().toObject(responseData);
    handleStatisticsOnPutIfAbsent(start,(Boolean)response);
  }
}
Program: 46152
Project: 46152
Buggy source:
protected Object putInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  Data expiryPolicyData=toData(expiryPolicy);
  boolean marked=!cacheOnUpdate || keyStateMarker.markIfUnmarked(keyData);
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Exception e) {
    resetToUnmarkedState(keyData);
    throw rethrow(e);
  }
  if (async) {
    return putInternalAsync(value,isGet,start,keyData,valueData,future,marked);
  }
  return putInternalSync(value,isGet,start,keyData,valueData,future,marked);
}

Fixed version (ground truth):
protected Object putInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  Data expiryPolicyData=toData(expiryPolicy);
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Exception e) {
    throw rethrow(e);
  }
  if (async) {
    return putInternalAsync(value,isGet,start,keyData,valueData,future);
  }
  return putInternalSync(value,isGet,start,keyData,valueData,future);
}
Program: 46153
Project: 46153
Buggy source:
@Override protected void onFailureInternal(Throwable t){
  if (nearCache != null && cacheOnUpdate) {
    resetToUnmarkedState(keyData);
  }
}

Fixed version (ground truth):
@Override protected void onFailureInternal(Throwable t){
}
Program: 46154
Project: 46154
Buggy source:
protected void invalidateNearCache(Data key){
  if (nearCache != null) {
    nearCache.remove(key);
  }
}

Fixed version (ground truth):
protected void invalidateNearCache(Data key){
  if (nearCache == null || key == null) {
    return;
  }
  nearCache.remove(key);
}
Program: 46155
Project: 46155
Buggy source:
@Override protected void onResponseInternal(V responseData){
  if (nearCache != null) {
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value,marked);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
  if (statisticsEnabled) {
    handleStatisticsOnPut(isGet,start,responseData);
  }
}

Fixed version (ground truth):
@Override protected void onResponseInternal(V responseData){
  if (nearCache != null) {
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
  if (statisticsEnabled) {
    handleStatisticsOnPut(isGet,start,responseData);
  }
}
Program: 46156
Project: 46156
Buggy source:
private void registerInvalidationListener(){
  if (nearCache == null || !nearCache.isInvalidatedOnChange()) {
    return;
  }
  int partitionCount=getContext().getPartitionService().getPartitionCount();
  nearCache=asInvalidationAware(nearCache,partitionCount);
  keyStateMarker=((InvalidationAwareWrapper)nearCache).getKeyStateMarker();
  ListenerMessageCodec listenerCodec=createInvalidationListenerCodec();
  ClientListenerService listenerService=clientContext.getListenerService();
  EventHandler eventHandler=createInvalidationEventHandler();
  nearCacheMembershipRegistrationId=listenerService.registerListener(listenerCodec,eventHandler);
}

Fixed version (ground truth):
private void registerInvalidationListener(){
  if (nearCache == null || !nearCache.isInvalidatedOnChange()) {
    return;
  }
  ListenerMessageCodec listenerCodec=createInvalidationListenerCodec();
  ClientListenerService listenerService=clientContext.getListenerService();
  EventHandler eventHandler=createInvalidationEventHandler();
  nearCacheMembershipRegistrationId=listenerService.registerListener(listenerCodec,eventHandler);
}
Program: 46157
Project: 46157
Buggy source:
@Override public void onFailure(Throwable t){
  if (nearCache != null && cacheOnUpdate) {
    resetToUnmarkedState(keyData);
  }
}

Fixed version (ground truth):
@Override public void onFailure(Throwable t){
}
Program: 46158
Project: 46158
Buggy source:
protected void storeInNearCache(Data key,Data valueData,V value,boolean marked){
  if (!marked) {
    return;
  }
  try {
    if (nearCache == null || valueData == null) {
      return;
    }
    Object valueToStore=nearCache.selectToSave(value,valueData);
    nearCache.put(key,valueToStore);
  }
  finally {
    resetToUnmarkedState(key);
  }
}

Fixed version (ground truth):
protected void storeInNearCache(Data key,Data valueData,V value,long reservationId,boolean cacheOnUpdate){
  if (nearCache == null || valueData == null) {
    return;
  }
  if (cacheOnUpdate) {
    Object valueToStore=nearCache.selectToSave(value,valueData);
    nearCache.put(key,valueToStore);
    return;
  }
  if (reservationId != NOT_RESERVED) {
    Object valueToStore=nearCache.selectToSave(value,valueData);
    nearCache.tryPublishReserved(key,valueToStore,reservationId,false);
  }
}
Program: 46159
Project: 46159
Buggy source:
protected Object putIfAbsentInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  boolean marked=!cacheOnUpdate || keyStateMarker.markIfUnmarked(keyData);
  Data expiryPolicyData=toData(expiryPolicy);
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutIfAbsentCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Exception e) {
    resetToUnmarkedState(keyData);
    throw rethrow(e);
  }
  ClientDelegatingFuture<Boolean> delegatingFuture=new ClientDelegatingFuture<Boolean>(future,clientContext.getSerializationService(),PUT_IF_ABSENT_RESPONSE_DECODER);
  if (async) {
    return putIfAbsentInternalAsync(value,start,keyData,valueData,delegatingFuture,marked);
  }
  return putIfAbsentInternalSync(value,start,keyData,valueData,delegatingFuture,marked);
}

Fixed version (ground truth):
protected Object putIfAbsentInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  Data expiryPolicyData=toData(expiryPolicy);
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutIfAbsentCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Throwable t) {
    throw rethrow(t);
  }
  ClientDelegatingFuture<Boolean> delegatingFuture=new ClientDelegatingFuture<Boolean>(future,clientContext.getSerializationService(),PUT_IF_ABSENT_RESPONSE_DECODER);
  if (async) {
    return putIfAbsentInternalAsync(value,start,keyData,valueData,delegatingFuture);
  }
  return putIfAbsentInternalSync(value,start,keyData,valueData,delegatingFuture);
}
Program: 46160
Project: 46160
Buggy source:
private Object putInternalSync(V value,boolean isGet,long start,Data keyData,Data valueData,ClientInvocationFuture future,boolean marked){
  try {
    ClientDelegatingFuture delegatingFuture=new ClientDelegatingFuture(future,clientContext.getSerializationService(),PUT_RESPONSE_DECODER);
    Object response=delegatingFuture.get();
    if (statisticsEnabled) {
      handleStatisticsOnPut(isGet,start,response);
    }
    return response;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
 finally {
    if (nearCache != null) {
      if (cacheOnUpdate) {
        storeInNearCache(keyData,valueData,value,marked);
      }
 else {
        invalidateNearCache(keyData);
      }
    }
  }
}

Fixed version (ground truth):
private Object putInternalSync(V value,boolean isGet,long start,Data keyData,Data valueData,ClientInvocationFuture future){
  try {
    ClientDelegatingFuture delegatingFuture=new ClientDelegatingFuture(future,clientContext.getSerializationService(),PUT_RESPONSE_DECODER);
    Object response=delegatingFuture.get();
    if (statisticsEnabled) {
      handleStatisticsOnPut(isGet,start,response);
    }
    return response;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
 finally {
    if (nearCache != null) {
      if (cacheOnUpdate) {
        storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
      }
 else {
        invalidateNearCache(keyData);
      }
    }
  }
}
Program: 46161
Project: 46161
Buggy source:
private Object putIfAbsentInternalAsync(final V value,final long start,final Data keyData,final Data valueData,ClientDelegatingFuture<Boolean> delegatingFuture,final boolean marked){
  if (nearCache != null || statisticsEnabled) {
    delegatingFuture.andThen(new ExecutionCallback<Boolean>(){
      @Override public void onResponse(      Boolean responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,marked);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          Object response=clientContext.getSerializationService().toObject(responseData);
          handleStatisticsOnPutIfAbsent(start,(Boolean)response);
        }
      }
      @Override public void onFailure(      Throwable t){
        if (nearCache != null && cacheOnUpdate) {
          resetToUnmarkedState(keyData);
        }
      }
    }
);
  }
  return delegatingFuture;
}

Fixed version (ground truth):
private Object putIfAbsentInternalAsync(final V value,final long start,final Data keyData,final Data valueData,ClientDelegatingFuture<Boolean> delegatingFuture){
  if (nearCache != null || statisticsEnabled) {
    delegatingFuture.andThen(new ExecutionCallback<Boolean>(){
      @Override public void onResponse(      Boolean responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          Object response=clientContext.getSerializationService().toObject(responseData);
          handleStatisticsOnPutIfAbsent(start,(Boolean)response);
        }
      }
      @Override public void onFailure(      Throwable t){
      }
    }
);
  }
  return delegatingFuture;
}
Program: 46162
Project: 46162
Buggy source:
private Object putIfAbsentInternalSync(V value,long start,Data keyData,Data valueData,ClientDelegatingFuture<Boolean> delegatingFuture,boolean marked){
  try {
    Object response=delegatingFuture.get();
    if (statisticsEnabled) {
      handleStatisticsOnPutIfAbsent(start,(Boolean)response);
    }
    return response;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
 finally {
    if (nearCache != null) {
      if (cacheOnUpdate) {
        storeInNearCache(keyData,valueData,value,marked);
      }
 else {
        invalidateNearCache(keyData);
      }
    }
  }
}

Fixed version (ground truth):
private Object putIfAbsentInternalSync(V value,long start,Data keyData,Data valueData,ClientDelegatingFuture<Boolean> delegatingFuture){
  try {
    Object response=delegatingFuture.get();
    if (statisticsEnabled) {
      handleStatisticsOnPutIfAbsent(start,(Boolean)response);
    }
    return response;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
 finally {
    if (nearCache != null) {
      if (cacheOnUpdate) {
        storeInNearCache(keyData,valueData,value,NOT_RESERVED,cacheOnUpdate);
      }
 else {
        invalidateNearCache(keyData);
      }
    }
  }
}
Program: 46163
Project: 46163
Buggy source:
@Override public boolean containsKey(K key){
  ensureOpen();
  validateNotNull(key);
  final Data keyData=toData(key);
  Object cached=nearCache != null ? nearCache.get(keyData) : null;
  if (cached != null && !NearCache.NULL_OBJECT.equals(cached)) {
    return true;
  }
  ClientMessage request=CacheContainsKeyCodec.encodeRequest(nameWithPrefix,keyData);
  ClientMessage result=invoke(request,keyData);
  return CacheContainsKeyCodec.decodeResponse(result).response;
}

Fixed version (ground truth):
@Override public boolean containsKey(K key){
  ensureOpen();
  validateNotNull(key);
  final Data keyData=toData(key);
  Object cached=getCachedValue(keyData,false);
  if (cached != NOT_CACHED) {
    return true;
  }
  ClientMessage request=CacheContainsKeyCodec.encodeRequest(nameWithPrefix,keyData);
  ClientMessage result=invoke(request,keyData);
  return CacheContainsKeyCodec.decodeResponse(result).response;
}
Program: 46164
Project: 46164
Buggy source:
public ExtractedParams(List<Data> keys,List<String> sourceUuids,List<UUID> partitionUuids,List<Long> sequences){
  this.keys=keys;
  this.sourceUuids=sourceUuids;
  this.partitionUuids=partitionUuids;
  this.sequences=sequences;
}

Fixed version (ground truth):
ExtractedParams(List<Data> keys,List<String> sourceUuids,List<UUID> partitionUuids,List<Long> sequences){
  this.keys=keys;
  this.sourceUuids=sourceUuids;
  this.partitionUuids=partitionUuids;
  this.sequences=sequences;
}
Program: 46165
Project: 46165
Buggy source:
@Override public Iterator<QueryableEntry> iterator(){
  if (entries == null) {
    if (indexedResults.isEmpty()) {
      entries=Collections.emptySet();
    }
 else {
      if (indexedResults.size() == 1) {
        entries=new HashSet<QueryableEntry>(indexedResults.get(0));
      }
 else {
        entries=new HashSet<QueryableEntry>();
        for (        Set<QueryableEntry> result : indexedResults) {
          entries.addAll(result);
        }
      }
    }
  }
  return entries.iterator();
}

Fixed version (ground truth):
@Override public Iterator<QueryableEntry> iterator(){
  return getEntries().iterator();
}
Program: 46166
Project: 46166
Buggy source:
@Override public int size(){
  if (indexedResults.isEmpty()) {
    return 0;
  }
 else {
    return indexedResults.get(0).size();
  }
}

Fixed version (ground truth):
@Override public int size(){
  return getEntries().size();
}
Program: 46167
Project: 46167
Buggy source:
@Override public Iterator<QueryableEntry> iterator(){
  if (entries == null) {
    if (indexedResults.isEmpty()) {
      entries=Collections.emptySet();
    }
 else {
      if (indexedResults.size() == 1) {
        entries=new HashSet<QueryableEntry>(indexedResults.get(0));
      }
 else {
        entries=new HashSet<QueryableEntry>();
        for (        Set<QueryableEntry> result : indexedResults) {
          entries.addAll(result);
        }
      }
    }
  }
  return entries.iterator();
}

Fixed version (ground truth):
@Override public Iterator<QueryableEntry> iterator(){
  return getEntries().iterator();
}
Program: 46168
Project: 46168
Buggy source:
@Override public int size(){
  if (indexedResults.isEmpty()) {
    return 0;
  }
 else {
    return indexedResults.get(0).size();
  }
}

Fixed version (ground truth):
@Override public int size(){
  return getEntries().size();
}
Program: 46169
Project: 46169
Buggy source:
@Test public void testListenersSmartRoutingTerminateRandomNode() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNodeInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRoutingTerminateRandomNode(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNode();
}
Program: 46170
Project: 46170
Buggy source:
@Test public void testListenersNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46171
Project: 46171
Buggy source:
@Test public void testListenersNonSmartRoutingMultipleServer() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRoutingMultipleServer(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46172
Project: 46172
Buggy source:
private void testListenersWaitMemberDestroy() throws InterruptedException {
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final int clusterSize=allHazelcastInstances.size();
  assertClusterSizeEventually(clusterSize,client);
  final AtomicInteger eventCount=new AtomicInteger();
  final String registrationId=addListener(eventCount);
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertTrue(disconnectedLatch.await(30,TimeUnit.SECONDS));
  assertTrue(connectedLatch.await(30,TimeUnit.SECONDS));
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  validateRegistrations(clusterSize - 1,registrationId,clientInstanceImpl);
  validateListenerFunctionality(eventCount);
  assertTrue(removeListener(registrationId));
}

Fixed version (ground truth):
private void testListenersWaitMemberDestroy(){
  setupListener();
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertOpenEventually(disconnectedLatch);
  assertOpenEventually(connectedLatch);
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  clusterSize=clusterSize - 1;
  validateRegistrationsAndListenerFunctionality();
}
Program: 46173
Project: 46173
Buggy source:
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(20).setConnectionAttemptPeriod(2000);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}

Fixed version (ground truth):
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  clientConfig.getNetworkConfig().setRedoOperation(true);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}
Program: 46174
Project: 46174
Buggy source:
@Test public void testClusterReconnectDueToHeartbeatSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectDueToHeartbeatSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46175
Project: 46175
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46176
Project: 46176
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerNonSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerNonSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46177
Project: 46177
Buggy source:
protected abstract String addListener(final AtomicInteger eventCount);

Fixed version (ground truth):
protected abstract String addListener();
Program: 46178
Project: 46178
Buggy source:
private void validateListenerFunctionality(final AtomicInteger eventCount){
  eventCount.set(0);
  for (int i=0; i < EVENT_COUNT; i++) {
    produceEvent();
  }
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertTrue("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,count >= EVENT_COUNT);
    }
  }
,5);
  assertTrueAllTheTime(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertEquals("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,EVENT_COUNT,eventCount.get());
    }
  }
,3);
}

Fixed version (ground truth):
private void validateListenerFunctionality(){
  for (int i=0; i < EVENT_COUNT; i++) {
    produceEvent();
  }
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertTrue("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,count >= EVENT_COUNT);
    }
  }
);
  assertTrueAllTheTime(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertEquals("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,EVENT_COUNT,eventCount.get());
    }
  }
,3);
}
Program: 46179
Project: 46179
Buggy source:
@Test public void testListenersSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46180
Project: 46180
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46181
Project: 46181
Buggy source:
@Test public void testClusterReconnectDueToHeartbeatNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectDueToHeartbeatNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46182
Project: 46182
Buggy source:
@Test public void testListenersSmartRoutingMultipleServer() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRoutingMultipleServer(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46183
Project: 46183
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46184
Project: 46184
Buggy source:
private void testListenersTemporaryNetworkBlockage(){
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance server=getOwnerServer(factory,clientInstanceImpl);
  final int clusterSize=factory.getAllHazelcastInstances().size();
  assertClusterSizeEventually(clusterSize,client);
  final AtomicInteger eventCount=new AtomicInteger();
  final String registrationId=addListener(eventCount);
  final boolean smartRouting=clientInstanceImpl.getClientConfig().getNetworkConfig().isSmartRouting();
  final int expectedRegistrationsSize=smartRouting ? clusterSize : 1;
  assertEquals(expectedRegistrationsSize,getClientEventRegistrations(client,registrationId).size());
  long timeout=clientInstanceImpl.getProperties().getMillis(HEARTBEAT_TIMEOUT);
  long heartbeatTimeout=timeout > 0 ? timeout : Integer.parseInt(HEARTBEAT_TIMEOUT.getDefaultValue());
  long waitTime=heartbeatTimeout / 2;
  validateListenerFunctionality(eventCount);
  long endTime=System.currentTimeMillis() + waitTime;
  blockMessagesFromInstance(server,client);
  long sleepTime=endTime - System.currentTimeMillis();
  if (sleepTime > 0) {
    sleepMillis((int)sleepTime);
  }
  unblockMessagesFromInstance(server,client);
  assertEquals(expectedRegistrationsSize,getClientEventRegistrations(client,registrationId).size());
  validateListenerFunctionality(eventCount);
  assertTrue(removeListener(registrationId));
}

Fixed version (ground truth):
private void testListenersTemporaryNetworkBlockage(){
  setupListener();
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance server=getOwnerServer(factory,clientInstanceImpl);
  long timeout=clientInstanceImpl.getProperties().getMillis(HEARTBEAT_TIMEOUT);
  long heartbeatTimeout=timeout > 0 ? timeout : Integer.parseInt(HEARTBEAT_TIMEOUT.getDefaultValue());
  long waitTime=heartbeatTimeout / 2;
  long endTime=System.currentTimeMillis() + waitTime;
  blockMessagesFromInstance(server,client);
  long sleepTime=endTime - System.currentTimeMillis();
  if (sleepTime > 0) {
    sleepMillis((int)sleepTime);
  }
  unblockMessagesFromInstance(server,client);
  validateRegistrationsAndListenerFunctionality();
}
Program: 46185
Project: 46185
Buggy source:
@Test public void testClusterReconnectMultipleServersDueToHeartbeatSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectMultipleServersDueToHeartbeatSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46186
Project: 46186
Buggy source:
@Test public void testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46187
Project: 46187
Buggy source:
@Test public void testListenersNonSmartRoutingTerminateRandomNode() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNodeInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRoutingTerminateRandomNode(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNode();
}
Program: 46188
Project: 46188
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iMap=client.getMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return iMap.addEntryListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iMap=client.getMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return iMap.addEntryListener(listener,true);
}
Program: 46189
Project: 46189
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iList=client.getList(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iList=client.getList(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}
Program: 46190
Project: 46190
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  multiMap=client.getMultiMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  multiMap=client.getMultiMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}
Program: 46191
Project: 46191
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iQueue=client.getQueue(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iQueue=client.getQueue(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}
Program: 46192
Project: 46192
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}
Program: 46193
Project: 46193
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iSet=client.getSet(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iSet=client.getSet(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}
Program: 46194
Project: 46194
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  topic=client.getTopic(randomString());
  MessageListener listener=new MessageListener(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  topic=client.getTopic(randomString());
  MessageListener listener=new MessageListener(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}
Program: 46195
Project: 46195
Buggy source:
@Test public void testListenersSmartRoutingTerminateRandomNode() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNodeInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRoutingTerminateRandomNode(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNode();
}
Program: 46196
Project: 46196
Buggy source:
@Test public void testListenersNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46197
Project: 46197
Buggy source:
@Test public void testListenersNonSmartRoutingMultipleServer() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRoutingMultipleServer(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46198
Project: 46198
Buggy source:
private void testListenersWaitMemberDestroy() throws InterruptedException {
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final int clusterSize=allHazelcastInstances.size();
  assertClusterSizeEventually(clusterSize,client);
  final AtomicInteger eventCount=new AtomicInteger();
  final String registrationId=addListener(eventCount);
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertTrue(disconnectedLatch.await(30,TimeUnit.SECONDS));
  assertTrue(connectedLatch.await(30,TimeUnit.SECONDS));
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  validateRegistrations(clusterSize - 1,registrationId,clientInstanceImpl);
  validateListenerFunctionality(eventCount);
  assertTrue(removeListener(registrationId));
}

Fixed version (ground truth):
private void testListenersWaitMemberDestroy(){
  setupListener();
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertOpenEventually(disconnectedLatch);
  assertOpenEventually(connectedLatch);
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  clusterSize=clusterSize - 1;
  validateRegistrationsAndListenerFunctionality();
}
Program: 46199
Project: 46199
Buggy source:
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(20).setConnectionAttemptPeriod(2000).setConnectionTimeout(5000);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}

Fixed version (ground truth):
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  clientConfig.getNetworkConfig().setRedoOperation(true);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}
Program: 46200
Project: 46200
Buggy source:
@Test public void testClusterReconnectDueToHeartbeatSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectDueToHeartbeatSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46201
Project: 46201
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}