nus-yam/ex-repair huggingface dataset:
Program: 46547
Project: 46547
Buggy source:
Connection get(int timeout) throws Throwable {
  countDownLatch.await(timeout,TimeUnit.MILLISECONDS);
  if (connection != null) {
    return connection;
  }
  if (throwable != null) {
    throw throwable;
  }
  throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
}

Fixed version (ground truth):
Connection get(int timeout) throws Throwable {
  if (!countDownLatch.await(timeout,TimeUnit.MILLISECONDS)) {
    throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
  }
  if (connection != null) {
    return connection;
  }
  throw throwable;
}
Program: 46548
Project: 46548
Buggy source:
@Override public void destroyDistributedObject(String name){
  mapServiceContext.destroyMap(name);
  nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME,name);
  Map<String,MapContainer> mapContainers=mapServiceContext.getMapContainers();
  MapContainer mapContainer=mapContainers.get(name);
  if (mapContainer != null) {
    mapServiceContext.getNearCacheProvider().destroyNearCache(name);
    mapContainer.getMapStoreContext().stop();
    mapContainers.remove(name);
  }
}

Fixed version (ground truth):
@Override public void destroyDistributedObject(String name){
  mapServiceContext.destroyMap(name);
}
Program: 46549
Project: 46549
Buggy source:
@Override public void destroyMap(final String mapName){
  localMapStatsProvider.destroyLocalMapStatsImpl(mapName);
  final PartitionContainer[] containers=partitionContainers;
  final Semaphore semaphore=new Semaphore(0);
  InternalOperationService operationService=(InternalOperationService)nodeEngine.getOperationService();
  for (  final PartitionContainer container : containers) {
    MapPartitionDestroyTask partitionDestroyTask=new MapPartitionDestroyTask(container,mapName,semaphore);
    operationService.execute(partitionDestroyTask);
  }
  try {
    semaphore.tryAcquire(containers.length,DESTROY_TIMEOUT_SECONDS,TimeUnit.SECONDS);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
@Override public void destroyMap(String mapName){
  MapContainer mapContainer=mapContainers.get(mapName);
  if (mapContainer == null) {
    return;
  }
  mapContainer.getMapStoreContext().stop();
  nearCacheProvider.destroyNearCache(mapName);
  nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME,mapName);
  localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName());
  destroyPartitionsAndMapContainer(mapContainer);
}
Program: 46550
Project: 46550
Buggy source:
public void destroyMap(String name){
  RecordStore recordStore=maps.remove(name);
  if (recordStore != null) {
    recordStore.destroy();
  }
 else {
    clearLockStore(name);
  }
}

Fixed version (ground truth):
public void destroyMap(MapContainer mapContainer){
  String name=mapContainer.getName();
  RecordStore recordStore=maps.remove(name);
  if (recordStore != null) {
    recordStore.destroy();
  }
 else {
    clearLockStore(name);
  }
  MapServiceContext mapServiceContext=mapService.getMapServiceContext();
  mapServiceContext.removeMapContainer(mapContainer);
}
Program: 46551
Project: 46551
Buggy source:
public MapPartitionDestroyTask(PartitionContainer partitionContainer,String mapName,Semaphore semaphore){
  this.partitionContainer=partitionContainer;
  this.mapName=mapName;
  this.semaphore=semaphore;
}

Fixed version (ground truth):
public MapPartitionDestroyTask(PartitionContainer container,MapContainer mapContainer,Semaphore semaphore){
  this.partitionContainer=container;
  this.mapContainer=mapContainer;
  this.semaphore=semaphore;
}
Program: 46552
Project: 46552
Buggy source:
@Override public void run(){
  partitionContainer.destroyMap(mapName);
  semaphore.release();
}

Fixed version (ground truth):
@Override public void run(){
  partitionContainer.destroyMap(mapContainer);
  semaphore.release();
}
Program: 46553
Project: 46553
Buggy source:
Connection get(int timeout) throws Throwable {
  countDownLatch.await(timeout,TimeUnit.MILLISECONDS);
  if (connection != null) {
    return connection;
  }
  if (throwable != null) {
    throw throwable;
  }
  throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
}

Fixed version (ground truth):
Connection get(int timeout) throws Throwable {
  if (!countDownLatch.await(timeout,TimeUnit.MILLISECONDS)) {
    throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
  }
  if (connection != null) {
    return connection;
  }
  throw throwable;
}
Program: 46554
Project: 46554
Buggy source:
Connection get(int timeout) throws Throwable {
  countDownLatch.await(timeout,TimeUnit.MILLISECONDS);
  if (connection != null) {
    return connection;
  }
  if (throwable != null) {
    throw throwable;
  }
  throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
}

Fixed version (ground truth):
Connection get(int timeout) throws Throwable {
  if (!countDownLatch.await(timeout,TimeUnit.MILLISECONDS)) {
    throw new TimeoutException("String_Node_Str" + timeout + "String_Node_Str");
  }
  if (connection != null) {
    return connection;
  }
  throw throwable;
}
Program: 46555
Project: 46555
Buggy source:
@Override public void destroyDistributedObject(String name){
  mapServiceContext.destroyMap(name);
  nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME,name);
  Map<String,MapContainer> mapContainers=mapServiceContext.getMapContainers();
  MapContainer mapContainer=mapContainers.get(name);
  if (mapContainer != null) {
    mapServiceContext.getNearCacheProvider().destroyNearCache(name);
    mapContainer.getMapStoreContext().stop();
    mapContainers.remove(name);
  }
}

Fixed version (ground truth):
@Override public void destroyDistributedObject(String name){
  mapServiceContext.destroyMap(name);
}
Program: 46556
Project: 46556
Buggy source:
@Override public void destroyMap(final String mapName){
  localMapStatsProvider.destroyLocalMapStatsImpl(mapName);
  final PartitionContainer[] containers=partitionContainers;
  final Semaphore semaphore=new Semaphore(0);
  InternalOperationService operationService=(InternalOperationService)nodeEngine.getOperationService();
  for (  final PartitionContainer container : containers) {
    MapPartitionDestroyTask partitionDestroyTask=new MapPartitionDestroyTask(container,mapName,semaphore);
    operationService.execute(partitionDestroyTask);
  }
  try {
    semaphore.tryAcquire(containers.length,DESTROY_TIMEOUT_SECONDS,TimeUnit.SECONDS);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
@Override public void destroyMap(String mapName){
  MapContainer mapContainer=mapContainers.get(mapName);
  if (mapContainer == null) {
    return;
  }
  mapContainer.getMapStoreContext().stop();
  nearCacheProvider.destroyNearCache(mapName);
  nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME,mapName);
  localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName());
  destroyPartitionsAndMapContainer(mapContainer);
}
Program: 46557
Project: 46557
Buggy source:
public void destroyMap(String name){
  RecordStore recordStore=maps.remove(name);
  if (recordStore != null) {
    recordStore.destroy();
  }
 else {
    clearLockStore(name);
  }
}

Fixed version (ground truth):
public void destroyMap(MapContainer mapContainer){
  String name=mapContainer.getName();
  RecordStore recordStore=maps.remove(name);
  if (recordStore != null) {
    recordStore.destroy();
  }
 else {
    clearLockStore(name);
  }
  MapServiceContext mapServiceContext=mapService.getMapServiceContext();
  mapServiceContext.removeMapContainer(mapContainer);
}
Program: 46558
Project: 46558
Buggy source:
public MapPartitionDestroyTask(PartitionContainer partitionContainer,String mapName,Semaphore semaphore){
  this.partitionContainer=partitionContainer;
  this.mapName=mapName;
  this.semaphore=semaphore;
}

Fixed version (ground truth):
public MapPartitionDestroyTask(PartitionContainer container,MapContainer mapContainer,Semaphore semaphore){
  this.partitionContainer=container;
  this.mapContainer=mapContainer;
  this.semaphore=semaphore;
}
Program: 46559
Project: 46559
Buggy source:
@Override public void run(){
  partitionContainer.destroyMap(mapName);
  semaphore.release();
}

Fixed version (ground truth):
@Override public void run(){
  partitionContainer.destroyMap(mapContainer);
  semaphore.release();
}
Program: 46560
Project: 46560
Buggy source:
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}

Fixed version (ground truth):
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  if (!alive) {
    throw new HazelcastException("String_Node_Str");
  }
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}
Program: 46561
Project: 46561
Buggy source:
public void doShutdown(){
  proxyManager.destroy();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  connectionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  ((InternalSerializationService)serializationService).dispose();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
  metricsRegistry.shutdown();
  performanceMonitor.shutdown();
}

Fixed version (ground truth):
public void doShutdown(){
  proxyManager.destroy();
  connectionManager.shutdown();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  ((InternalSerializationService)serializationService).dispose();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
  metricsRegistry.shutdown();
  performanceMonitor.shutdown();
}
Program: 46562
Project: 46562
Buggy source:
void listenMembershipEvents(Address ownerConnectionAddress){
  initialListFetchedLatch=new CountDownLatch(1);
  try {
    ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
    Connection connection=connectionManager.getConnection(ownerConnectionAddress);
    if (connection == null) {
      throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
    }
    ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
    invocation.setEventHandler(this);
    invocation.invokeUrgent().get();
    waitInitialMemberListFetched();
  }
 catch (  Exception e) {
    if (client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.warning("String_Node_Str" + ownerConnectionAddress,e);
      }
 else {
        logger.warning("String_Node_Str" + ownerConnectionAddress + "String_Node_Str"+ e.toString());
      }
    }
  }
}

Fixed version (ground truth):
void listenMembershipEvents(Address ownerConnectionAddress) throws Exception {
  initialListFetchedLatch=new CountDownLatch(1);
  ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
  Connection connection=connectionManager.getConnection(ownerConnectionAddress);
  if (connection == null) {
    throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
  }
  ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
  invocation.setEventHandler(this);
  invocation.invokeUrgent().get();
  waitInitialMemberListFetched();
}
Program: 46563
Project: 46563
Buggy source:
protected void connectToCluster() throws Exception {
  connectToOne();
  clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
}

Fixed version (ground truth):
public void connectToCluster() throws Exception {
  ownerConnectionAddress=null;
  final ClientNetworkConfig networkConfig=client.getClientConfig().getNetworkConfig();
  final int connAttemptLimit=networkConfig.getConnectionAttemptLimit();
  final int connectionAttemptPeriod=networkConfig.getConnectionAttemptPeriod();
  final int connectionAttemptLimit=connAttemptLimit == 0 ? Integer.MAX_VALUE : connAttemptLimit;
  int attempt=0;
  Set<InetSocketAddress> triedAddresses=new HashSet<InetSocketAddress>();
  while (attempt < connectionAttemptLimit) {
    if (!client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
      break;
    }
    attempt++;
    final long nextTry=Clock.currentTimeMillis() + connectionAttemptPeriod;
    boolean isConnected=connect(triedAddresses);
    if (isConnected) {
      return;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    logger.warning(String.format("String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + triedAddresses);
}
Program: 46564
Project: 46564
Buggy source:
public void shutdown(){
  clusterExecutor.shutdown();
}

Fixed version (ground truth):
public void shutdown(){
  clusterExecutor.shutdown();
  try {
    boolean success=clusterExecutor.awaitTermination(TERMINATE_TIMEOUT_SECONDS,TimeUnit.SECONDS);
    if (!success) {
      logger.warning("String_Node_Str" + TERMINATE_TIMEOUT_SECONDS + "String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    logger.warning("String_Node_Str",e);
  }
}
Program: 46565
Project: 46565
Buggy source:
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      ownerConnectionAddress=connection.getEndPoint();
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      logger.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    if (!client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
      break;
    }
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      ownerConnectionAddress=connection.getEndPoint();
      clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      logger.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}
Program: 46566
Project: 46566
Buggy source:
@Test @Ignore public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}

Fixed version (ground truth):
@Test public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t.getCause() instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}
Program: 46567
Project: 46567
Buggy source:
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}

Fixed version (ground truth):
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  if (!alive) {
    throw new HazelcastException("String_Node_Str");
  }
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}
Program: 46568
Project: 46568
Buggy source:
public void doShutdown(){
  proxyManager.destroy();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  connectionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  serializationService.destroy();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
}

Fixed version (ground truth):
public void doShutdown(){
  proxyManager.destroy();
  connectionManager.shutdown();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  serializationService.destroy();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
}
Program: 46569
Project: 46569
Buggy source:
void listenMembershipEvents(Address ownerConnectionAddress){
  initialListFetchedLatch=new CountDownLatch(1);
  try {
    ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
    Connection connection=connectionManager.getConnection(ownerConnectionAddress);
    if (connection == null) {
      throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
    }
    ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
    invocation.setEventHandler(this);
    invocation.invokeUrgent().get();
    waitInitialMemberListFetched();
  }
 catch (  Exception e) {
    if (client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.warning("String_Node_Str" + ownerConnectionAddress,e);
      }
 else {
        LOGGER.warning("String_Node_Str" + ownerConnectionAddress + "String_Node_Str"+ e.toString());
      }
    }
  }
}

Fixed version (ground truth):
void listenMembershipEvents(Address ownerConnectionAddress) throws Exception {
  initialListFetchedLatch=new CountDownLatch(1);
  ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
  Connection connection=connectionManager.getConnection(ownerConnectionAddress);
  if (connection == null) {
    throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
  }
  ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
  invocation.setEventHandler(this);
  invocation.invokeUrgent().get();
  waitInitialMemberListFetched();
}
Program: 46570
Project: 46570
Buggy source:
protected void connectToCluster() throws Exception {
  connectToOne();
  clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
}

Fixed version (ground truth):
public void connectToCluster() throws Exception {
  ownerConnectionAddress=null;
  final ClientNetworkConfig networkConfig=client.getClientConfig().getNetworkConfig();
  final int connAttemptLimit=networkConfig.getConnectionAttemptLimit();
  final int connectionAttemptPeriod=networkConfig.getConnectionAttemptPeriod();
  final int connectionAttemptLimit=connAttemptLimit == 0 ? Integer.MAX_VALUE : connAttemptLimit;
  int attempt=0;
  Set<InetSocketAddress> triedAddresses=new HashSet<InetSocketAddress>();
  while (attempt < connectionAttemptLimit) {
    if (!client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str");
      }
      break;
    }
    attempt++;
    final long nextTry=Clock.currentTimeMillis() + connectionAttemptPeriod;
    boolean isConnected=connect(triedAddresses);
    if (isConnected) {
      return;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    LOGGER.warning(String.format("String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + triedAddresses);
}
Program: 46571
Project: 46571
Buggy source:
public void shutdown(){
  clusterExecutor.shutdown();
}

Fixed version (ground truth):
public void shutdown(){
  clusterExecutor.shutdown();
  try {
    boolean success=clusterExecutor.awaitTermination(TERMINATE_TIMEOUT_SECONDS,TimeUnit.SECONDS);
    if (!success) {
      LOGGER.warning("String_Node_Str" + TERMINATE_TIMEOUT_SECONDS + "String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    LOGGER.warning("String_Node_Str",e);
  }
}
Program: 46572
Project: 46572
Buggy source:
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      ownerConnectionAddress=connection.getEndPoint();
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      LOGGER.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    if (!client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str");
      }
      break;
    }
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      ownerConnectionAddress=connection.getEndPoint();
      clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      LOGGER.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}
Program: 46573
Project: 46573
Buggy source:
@Test public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}

Fixed version (ground truth):
@Test public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t.getCause() instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}
Program: 46574
Project: 46574
Buggy source:
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}

Fixed version (ground truth):
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  if (!alive) {
    throw new HazelcastException("String_Node_Str");
  }
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}
Program: 46575
Project: 46575
Buggy source:
public void doShutdown(){
  proxyManager.destroy();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  connectionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  ((InternalSerializationService)serializationService).dispose();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
  metricsRegistry.shutdown();
  performanceMonitor.shutdown();
}

Fixed version (ground truth):
public void doShutdown(){
  proxyManager.destroy();
  connectionManager.shutdown();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  ((InternalSerializationService)serializationService).dispose();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
  metricsRegistry.shutdown();
  performanceMonitor.shutdown();
}
Program: 46576
Project: 46576
Buggy source:
void listenMembershipEvents(Address ownerConnectionAddress){
  initialListFetchedLatch=new CountDownLatch(1);
  try {
    ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
    Connection connection=connectionManager.getConnection(ownerConnectionAddress);
    if (connection == null) {
      throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
    }
    ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
    invocation.setEventHandler(this);
    invocation.invokeUrgent().get();
    waitInitialMemberListFetched();
  }
 catch (  Exception e) {
    if (client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.warning("String_Node_Str" + ownerConnectionAddress,e);
      }
 else {
        logger.warning("String_Node_Str" + ownerConnectionAddress + "String_Node_Str"+ e.toString());
      }
    }
  }
}

Fixed version (ground truth):
void listenMembershipEvents(Address ownerConnectionAddress) throws Exception {
  initialListFetchedLatch=new CountDownLatch(1);
  ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
  Connection connection=connectionManager.getConnection(ownerConnectionAddress);
  if (connection == null) {
    throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
  }
  ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
  invocation.setEventHandler(this);
  invocation.invokeUrgent().get();
  waitInitialMemberListFetched();
}
Program: 46577
Project: 46577
Buggy source:
protected void connectToCluster() throws Exception {
  connectToOne();
  clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
}

Fixed version (ground truth):
public void connectToCluster() throws Exception {
  ownerConnectionAddress=null;
  final ClientNetworkConfig networkConfig=client.getClientConfig().getNetworkConfig();
  final int connAttemptLimit=networkConfig.getConnectionAttemptLimit();
  final int connectionAttemptPeriod=networkConfig.getConnectionAttemptPeriod();
  final int connectionAttemptLimit=connAttemptLimit == 0 ? Integer.MAX_VALUE : connAttemptLimit;
  int attempt=0;
  Set<InetSocketAddress> triedAddresses=new HashSet<InetSocketAddress>();
  while (attempt < connectionAttemptLimit) {
    if (!client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
      break;
    }
    attempt++;
    final long nextTry=Clock.currentTimeMillis() + connectionAttemptPeriod;
    boolean isConnected=connect(triedAddresses);
    if (isConnected) {
      return;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    logger.warning(String.format("String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + triedAddresses);
}
Program: 46578
Project: 46578
Buggy source:
public void shutdown(){
  clusterExecutor.shutdown();
}

Fixed version (ground truth):
public void shutdown(){
  clusterExecutor.shutdown();
  try {
    boolean success=clusterExecutor.awaitTermination(TERMINATE_TIMEOUT_SECONDS,TimeUnit.SECONDS);
    if (!success) {
      logger.warning("String_Node_Str" + TERMINATE_TIMEOUT_SECONDS + "String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    logger.warning("String_Node_Str",e);
  }
}
Program: 46579
Project: 46579
Buggy source:
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      ownerConnectionAddress=connection.getEndPoint();
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      logger.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    if (!client.getLifecycleService().isRunning()) {
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str");
      }
      break;
    }
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (logger.isFinestEnabled()) {
        logger.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      ownerConnectionAddress=connection.getEndPoint();
      clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      logger.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}
Program: 46580
Project: 46580
Buggy source:
@Test @Ignore public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}

Fixed version (ground truth):
@Test public void executionCallback_FailOnShutdown(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  IMap<Object,Object> map=client.getMap(randomName());
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (event.getState() == LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED) {
        disconnectedLatch.countDown();
      }
    }
  }
);
  server.shutdown();
  assertOpenEventually(disconnectedLatch);
  final CountDownLatch shutdownLatch=new CountDownLatch(1);
  int n=100;
  final CountDownLatch errorLatch=new CountDownLatch(n);
  for (int i=0; i < n; i++) {
    map.submitToKey(randomString(),new DummyEntryProcessor(),new ExecutionCallback(){
      @Override public void onResponse(      Object response){
      }
      @Override public void onFailure(      Throwable t){
        if (t.getCause() instanceof HazelcastClientNotActiveException) {
          shutdownLatch.countDown();
        }
        errorLatch.countDown();
      }
    }
);
  }
  assertOpenEventually("String_Node_Str",shutdownLatch);
  assertOpenEventually("String_Node_Str",errorLatch);
}
Program: 46581
Project: 46581
Buggy source:
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}

Fixed version (ground truth):
private AuthenticationFuture triggerConnect(Address target,boolean asOwner){
  if (!alive) {
    throw new HazelcastException("String_Node_Str");
  }
  AuthenticationFuture callback=new AuthenticationFuture();
  AuthenticationFuture firstCallback=connectionsInProgress.putIfAbsent(target,callback);
  if (firstCallback == null) {
    ClientExecutionServiceImpl executionService=(ClientExecutionServiceImpl)client.getClientExecutionService();
    executionService.executeInternal(new InitConnectionTask(target,asOwner,callback));
    return callback;
  }
  return firstCallback;
}
Program: 46582
Project: 46582
Buggy source:
public void doShutdown(){
  proxyManager.destroy();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  connectionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  serializationService.destroy();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
}

Fixed version (ground truth):
public void doShutdown(){
  proxyManager.destroy();
  connectionManager.shutdown();
  clusterService.shutdown();
  executionService.shutdown();
  partitionService.stop();
  transactionManager.shutdown();
  invocationService.shutdown();
  listenerService.shutdown();
  serializationService.destroy();
  nearCacheManager.destroyAllNearCaches();
  if (discoveryService != null) {
    discoveryService.destroy();
  }
}
Program: 46583
Project: 46583
Buggy source:
void listenMembershipEvents(Address ownerConnectionAddress){
  initialListFetchedLatch=new CountDownLatch(1);
  try {
    ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
    Connection connection=connectionManager.getConnection(ownerConnectionAddress);
    if (connection == null) {
      throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
    }
    ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
    invocation.setEventHandler(this);
    invocation.invokeUrgent().get();
    waitInitialMemberListFetched();
  }
 catch (  Exception e) {
    if (client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.warning("String_Node_Str" + ownerConnectionAddress,e);
      }
 else {
        LOGGER.warning("String_Node_Str" + ownerConnectionAddress + "String_Node_Str"+ e.toString());
      }
    }
  }
}

Fixed version (ground truth):
void listenMembershipEvents(Address ownerConnectionAddress) throws Exception {
  initialListFetchedLatch=new CountDownLatch(1);
  ClientMessage clientMessage=ClientAddMembershipListenerCodec.encodeRequest(false);
  Connection connection=connectionManager.getConnection(ownerConnectionAddress);
  if (connection == null) {
    throw new IllegalStateException("String_Node_Str" + ownerConnectionAddress);
  }
  ClientInvocation invocation=new ClientInvocation(client,clientMessage,connection);
  invocation.setEventHandler(this);
  invocation.invokeUrgent().get();
  waitInitialMemberListFetched();
}
Program: 46584
Project: 46584
Buggy source:
protected void connectToCluster() throws Exception {
  connectToOne();
  clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
}

Fixed version (ground truth):
public void connectToCluster() throws Exception {
  ownerConnectionAddress=null;
  final ClientNetworkConfig networkConfig=client.getClientConfig().getNetworkConfig();
  final int connAttemptLimit=networkConfig.getConnectionAttemptLimit();
  final int connectionAttemptPeriod=networkConfig.getConnectionAttemptPeriod();
  final int connectionAttemptLimit=connAttemptLimit == 0 ? Integer.MAX_VALUE : connAttemptLimit;
  int attempt=0;
  Set<InetSocketAddress> triedAddresses=new HashSet<InetSocketAddress>();
  while (attempt < connectionAttemptLimit) {
    if (!client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str");
      }
      break;
    }
    attempt++;
    final long nextTry=Clock.currentTimeMillis() + connectionAttemptPeriod;
    boolean isConnected=connect(triedAddresses);
    if (isConnected) {
      return;
    }
    final long remainingTime=nextTry - Clock.currentTimeMillis();
    LOGGER.warning(String.format("String_Node_Str",Math.max(0,remainingTime),attempt,connectionAttemptLimit));
    if (remainingTime > 0) {
      try {
        Thread.sleep(remainingTime);
      }
 catch (      InterruptedException e) {
        break;
      }
    }
  }
  throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + triedAddresses);
}
Program: 46585
Project: 46585
Buggy source:
public void shutdown(){
  clusterExecutor.shutdown();
}

Fixed version (ground truth):
public void shutdown(){
  clusterExecutor.shutdown();
  try {
    boolean success=clusterExecutor.awaitTermination(TERMINATE_TIMEOUT_SECONDS,TimeUnit.SECONDS);
    if (!success) {
      LOGGER.warning("String_Node_Str" + TERMINATE_TIMEOUT_SECONDS + "String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    LOGGER.warning("String_Node_Str",e);
  }
}
Program: 46586
Project: 46586
Buggy source:
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      ownerConnectionAddress=connection.getEndPoint();
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      LOGGER.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
  final Collection<InetSocketAddress> socketAddresses=getSocketAddresses();
  for (  InetSocketAddress inetSocketAddress : socketAddresses) {
    if (!client.getLifecycleService().isRunning()) {
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str");
      }
      break;
    }
    try {
      triedAddresses.add(inetSocketAddress);
      Address address=new Address(inetSocketAddress);
      if (LOGGER.isFinestEnabled()) {
        LOGGER.finest("String_Node_Str" + address);
      }
      Connection connection=connectionManager.getOrConnect(address,true);
      ownerConnectionAddress=connection.getEndPoint();
      clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
      fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
      return true;
    }
 catch (    Exception e) {
      Level level=e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
      LOGGER.log(level,"String_Node_Str" + inetSocketAddress,e);
    }
  }
  return false;
}