nus-yam/ex-repair huggingface dataset:
Program: 49451
Project: 49451
Buggy source:
/** 
 * Initializes the default Hazelcast instance with the specified configuration. This method should be called before calling any other methods.
 * @param config configuration for this Hazelcast instance.
 * @return the default instance
 * @throws IllegalStateException if this instance is already initialized
 * @deprecated as of version 2.2
 * @see #newHazelcastInstance(com.hazelcast.config.Config)
 * @see #getHazelcastInstanceByName(String)
 * @see #getAllHazelcastInstances()
 */
@Deprecated public static HazelcastInstance init(Config config){
  if (defaultInstance.get() != null) {
    throw new IllegalStateException("String_Node_Str");
  }
synchronized (initLock) {
    if (defaultInstance.get() != null) {
      throw new IllegalStateException("String_Node_Str");
    }
    defaultConfig=config;
    HazelcastInstance defaultInstanceObject=com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(config,null);
    defaultInstance.set(defaultInstanceObject);
    return defaultInstanceObject;
  }
}

Fixed version (ground truth):
/** 
 * Initializes the default Hazelcast instance with the specified configuration. This method should be called before calling any other methods.
 * @param config configuration for this Hazelcast instance.
 * @return the default instance
 * @throws IllegalStateException if this instance is already initialized
 * @deprecated as of version 2.2
 * @see #newHazelcastInstance(com.hazelcast.config.Config)
 * @see #getHazelcastInstanceByName(String)
 * @see #getAllHazelcastInstances()
 */
@Deprecated public static HazelcastInstance init(Config config){
  if (defaultInstance.get() != null) {
    throw new IllegalStateException("String_Node_Str");
  }
synchronized (initLock) {
    if (defaultInstance.get() != null) {
      throw new IllegalStateException("String_Node_Str");
    }
    defaultConfig=config;
    HazelcastInstance defaultInstanceObject=com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(config);
    defaultInstance.set(defaultInstanceObject);
    return defaultInstanceObject;
  }
}
Program: 49452
Project: 49452
Buggy source:
/** 
 * Creates a new HazelcastInstance (a new node in a cluster). This method allows you to create and run multiple instances of Hazelcast cluster members on the same JVM. <p/> To shutdown all running HazelcastInstances (all members on this JVM) call   {@link #shutdownAll()}. Hazelcast will look into two places for the configuration file: <ol> <li> System property: Hazelcast will first check if "hazelcast.config" system property is set to a file path. Example: -Dhazelcast.config=C:/myhazelcast.xml. </li> <li> Classpath: If config file is not set as a system property, Hazelcast will check classpath for hazelcast.xml file. </li> </ol> If Hazelcast doesn't find any config file, it will happily start with default configuration (hazelcast-default.xml) located in hazelcast.jar.
 * @return new HazelcastInstance
 * @see #shutdownAll()
 * @see #getHazelcastInstanceByName(String)
 */
public static HazelcastInstance newHazelcastInstance(){
  return com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(null,null);
}

Fixed version (ground truth):
/** 
 * Creates a new HazelcastInstance (a new node in a cluster). This method allows you to create and run multiple instances of Hazelcast cluster members on the same JVM. <p/> To shutdown all running HazelcastInstances (all members on this JVM) call   {@link #shutdownAll()}. Hazelcast will look into two places for the configuration file: <ol> <li> System property: Hazelcast will first check if "hazelcast.config" system property is set to a file path. Example: -Dhazelcast.config=C:/myhazelcast.xml. </li> <li> Classpath: If config file is not set as a system property, Hazelcast will check classpath for hazelcast.xml file. </li> </ol> If Hazelcast doesn't find any config file, it will happily start with default configuration (hazelcast-default.xml) located in hazelcast.jar.
 * @return new HazelcastInstance
 * @see #shutdownAll()
 * @see #getHazelcastInstanceByName(String)
 */
public static HazelcastInstance newHazelcastInstance(){
  return com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy();
}
Program: 49454
Project: 49454
Buggy source:
public void run(){
  try {
    Thread.sleep(3000 * finalI);
    HazelcastInstance instance=Hazelcast.newHazelcastInstance(config);
    instances.set(finalI,instance);
    Thread.sleep(rand.nextInt(100));
    if (finalI != 0) {
      for (int j=0; j < 10000; j++) {
        instance.getMap(name).put(getName() + "String_Node_Str" + j,"String_Node_Str");
      }
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  for (int j=(n * chunk); j < (n + 1) * chunk; j++) {
    map.remove(j);
    try {
      Thread.sleep(1);
    }
 catch (    InterruptedException ignored) {
    }
  }
  latch.countDown();
}
Program: 49455
Project: 49455
Buggy source:
public Object poll(final String name,long timeout) throws InterruptedException {
  if (timeout == -1) {
    timeout=Long.MAX_VALUE;
  }
  Object removedItem=null;
  long start=Clock.currentTimeMillis();
  while (removedItem == null && timeout >= 0) {
    Data key=takeKey(name,timeout);
    if (key == null) {
      return null;
    }
    IMap imap=getStorageMap(name);
    try {
      removedItem=imap.tryRemove(key,0,TimeUnit.MILLISECONDS);
      if (removedItem != null) {
        ThreadContext threadContext=ThreadContext.get();
        TransactionImpl txn=threadContext.getCallContext().getTransaction();
        final Data removedItemData=toData(removedItem);
        if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
          txn.attachRemoveOp(name,key,removedItemData,true);
        }
        fireQueueEvent(name,EntryEventType.REMOVED,removedItemData);
      }
    }
 catch (    TimeoutException e) {
      throw new OperationTimeoutException();
    }
    long now=Clock.currentTimeMillis();
    timeout-=(now - start);
    start=now;
  }
  return removedItem;
}

Fixed version (ground truth):
public Object poll(final String name,long timeout) throws InterruptedException {
  if (timeout == -1) {
    timeout=Long.MAX_VALUE;
  }
  Object removedItem=null;
  long start=Clock.currentTimeMillis();
  while (removedItem == null && timeout >= 0) {
    Data key=takeKey(name,timeout);
    if (key == null) {
      return null;
    }
    IMap imap=getStorageMap(name);
    try {
      removedItem=imap.tryRemove(key,0,TimeUnit.MILLISECONDS);
      if (removedItem != null) {
        ThreadContext threadContext=ThreadContext.get();
        TransactionImpl txn=threadContext.getCallContext().getTransaction();
        final Data removedItemData=toData(removedItem);
        if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
          txn.attachRemoveOp(name,key,removedItemData,true);
        }
        fireQueueEvent(name,EntryEventType.REMOVED,removedItemData);
      }
    }
 catch (    TimeoutException e) {
      throw new OperationTimeoutException(e);
    }
    long now=Clock.currentTimeMillis();
    timeout-=(now - start);
    start=now;
  }
  return removedItem;
}
Program: 49456
Project: 49456
Buggy source:
public void rollbackPoll(String name,Object key,Object obj){
  final Data dataKey=toData(key);
  if (addKeyAsync) {
    sendKeyToMaster(name,dataKey,0);
  }
 else {
    addKey(name,dataKey,0);
  }
}

Fixed version (ground truth):
public void rollbackPoll(String name,Object key){
  final Data dataKey=toData(key);
  if (addKeyAsync) {
    sendKeyToMaster(name,dataKey,0);
  }
 else {
    addKey(name,dataKey,0);
  }
}
Program: 49458
Project: 49458
Buggy source:
public void rollbackMap(){
  MProxy mapProxy=null;
  Object proxy=factory.getOrCreateProxyByName(name);
  if (proxy instanceof MProxy) {
    mapProxy=(MProxy)proxy;
  }
  if (mapProxy != null)   mapProxy.unlock(key);
}

Fixed version (ground truth):
public void rollbackMap(){
  factory.node.concurrentMapManager.new MLock().unlock(name,key,-1);
}
Program: 49459
Project: 49459
Buggy source:
public void rollbackQueue(){
  if (removed) {
    factory.node.blockingQueueManager.rollbackPoll(name,key,value);
  }
}

Fixed version (ground truth):
public void rollbackQueue(){
  if (removed) {
    factory.node.blockingQueueManager.rollbackPoll(name,key);
  }
}
Program: 49460
Project: 49460
Buggy source:
public void close0() throws IOException {
  if (!live)   return;
  live=false;
  if (socketChannel != null && socketChannel.isOpen()) {
    socketChannel.close();
  }
  readHandler.shutdown();
  writeHandler.shutdown();
}

Fixed version (ground truth):
public void close0() throws IOException {
  if (!live) {
    return;
  }
  readHandler.shutdown();
  writeHandler.shutdown();
  live=false;
  if (socketChannel != null && socketChannel.isOpen()) {
    socketChannel.close();
  }
}
Program: 49461
Project: 49461
Buggy source:
private void stop(){
  live=false;
  log(Level.FINEST,"String_Node_Str");
  shutdownSocketAcceptor();
  ioService.onShutdown();
  for (  Connection conn : mapConnections.values()) {
    try {
      destroyConnection(conn);
    }
 catch (    final Throwable ignore) {
      logger.log(Level.FINEST,ignore.getMessage(),ignore);
    }
  }
  for (  Connection conn : setActiveConnections) {
    try {
      destroyConnection(conn);
    }
 catch (    final Throwable ignore) {
      logger.log(Level.FINEST,ignore.getMessage(),ignore);
    }
  }
  shutdownIOSelectors();
  setConnectionInProgress.clear();
  mapConnections.clear();
  mapMonitors.clear();
  setActiveConnections.clear();
}

Fixed version (ground truth):
private void stop(){
  live=false;
  log(Level.FINEST,"String_Node_Str");
  shutdownSocketAcceptor();
  ioService.onShutdown();
  closeConnections(mapConnections.values());
  closeConnections(setActiveConnections);
  shutdownIOSelectors();
  setConnectionInProgress.clear();
  mapConnections.clear();
  mapMonitors.clear();
  setActiveConnections.clear();
}
Program: 49462
Project: 49462
Buggy source:
@Override public void shutdown(){
  Object obj=poll();
  while (obj != null) {
    obj=poll();
  }
}

Fixed version (ground truth):
@Override public void shutdown(){
  writeQueue.clear();
}
Program: 49463
Project: 49463
Buggy source:
private Address createAddress(final AddressDefinition addressDef,final int port) throws UnknownHostException {
  return new Address(addressDef.host != null ? addressDef.host : addressDef.address,port);
}

Fixed version (ground truth):
private Address createAddress(final AddressDefinition addressDef,final int port) throws UnknownHostException {
  return addressDef.host != null ? new Address(addressDef.host,port) : new Address(addressDef.inetAddress,port);
}
Program: 49464
Project: 49464
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler);

Fixed version (ground truth):
void searchForOtherClusters(SplitBrainHandler splitBrainHandler);
Program: 49465
Project: 49465
Buggy source:
public void join(AtomicBoolean joined);

Fixed version (ground truth):
void join(AtomicBoolean joined);
Program: 49467
Project: 49467
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterService().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.WARNING,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterService.checkJoin(possibleAddress);
      System.out.println("String_Node_Str" + response);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        targetAddress=possibleAddress;
        sendClusterMergeToOthers(targetAddress);
        splitBrainHandler.restart();
        return;
      }
    }
  }
}

Fixed version (ground truth):
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterService().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterService.checkJoinInfo(possibleAddress);
      System.out.println("String_Node_Str" + response);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        targetAddress=possibleAddress;
        sendClusterMergeToOthers(targetAddress);
        splitBrainHandler.restart();
        return;
      }
    }
  }
}
Program: 49469
Project: 49469
Buggy source:
public void run(){
  if (!connectionManager.isLive()) {
    String message="String_Node_Str" + address + "String_Node_Str";
    log(Level.FINEST,message);
    return;
  }
  try {
    connectionManager.ioService.onIOThreadStart();
    log(Level.FINEST,"String_Node_Str" + address);
    final Address thisAddress=connectionManager.ioService.getThisAddress();
    if (address.isIPv4()) {
      tryToConnect(address.getInetSocketAddress(),0);
    }
 else     if (thisAddress.isIPv6() && thisAddress.getScopeId() != null) {
      final Inet6Address inetAddress=AddressUtil.getInetAddressFor((Inet6Address)address.getInetAddress(),thisAddress.getScopeId());
      tryToConnect(new InetSocketAddress(inetAddress,address.getPort()),0);
    }
 else {
      final Collection<Inet6Address> possibleInetAddresses=AddressUtil.getPossibleInetAddressesFor((Inet6Address)address.getInetAddress());
      log(Level.INFO,"String_Node_Str" + possibleInetAddresses);
      boolean connected=false;
      Exception error=null;
      for (      Inet6Address inetAddress : possibleInetAddresses) {
        try {
          tryToConnect(new InetSocketAddress(inetAddress,address.getPort()),3000);
          connected=true;
          break;
        }
 catch (        Exception e) {
          error=e;
        }
      }
      if (!connected) {
        throw error;
      }
    }
  }
 catch (  Throwable e) {
    logger.log(Level.FINEST,e.getMessage(),e);
    connectionManager.failedConnection(address,e,silent);
  }
}

Fixed version (ground truth):
public void run(){
  if (!connectionManager.isLive()) {
    String message="String_Node_Str" + address + "String_Node_Str";
    log(Level.FINEST,message);
    return;
  }
  try {
    connectionManager.ioService.onIOThreadStart();
    log(Level.FINEST,"String_Node_Str" + address);
    final Address thisAddress=connectionManager.ioService.getThisAddress();
    if (address.isIPv4()) {
      tryToConnect(address.getInetSocketAddress(),0);
    }
 else     if (thisAddress.isIPv6() && thisAddress.getScopeId() != null) {
      final Inet6Address inetAddress=AddressUtil.getInetAddressFor((Inet6Address)address.getInetAddress(),thisAddress.getScopeId());
      tryToConnect(new InetSocketAddress(inetAddress,address.getPort()),0);
    }
 else {
      final Collection<Inet6Address> possibleInetAddresses=AddressUtil.getPossibleInetAddressesFor((Inet6Address)address.getInetAddress());
      final Level level=silent ? Level.FINEST : Level.INFO;
      log(level,"String_Node_Str" + possibleInetAddresses);
      boolean connected=false;
      Exception error=null;
      for (      Inet6Address inetAddress : possibleInetAddresses) {
        try {
          tryToConnect(new InetSocketAddress(inetAddress,address.getPort()),3000);
          connected=true;
          break;
        }
 catch (        Exception e) {
          error=e;
        }
      }
      if (!connected) {
        throw error;
      }
    }
  }
 catch (  Throwable e) {
    logger.log(Level.FINEST,e.getMessage(),e);
    connectionManager.failedConnection(address,e,silent);
  }
}
Program: 49470
Project: 49470
Buggy source:
public static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address){
  if (inet6Address.getScopeId() <= 0 && inet6Address.getScopedInterface() == null) {
    final LinkedList<Inet6Address> possibleAddresses=new LinkedList<Inet6Address>();
    try {
      final Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
      while (interfaces.hasMoreElements()) {
        NetworkInterface ni=interfaces.nextElement();
        Enumeration<InetAddress> addresses=ni.getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress address=addresses.nextElement();
          if (address instanceof Inet4Address) {
            continue;
          }
          if (inet6Address.isLinkLocalAddress() && address.isLinkLocalAddress() || inet6Address.isSiteLocalAddress() && address.isSiteLocalAddress()) {
            final Inet6Address newAddress=Inet6Address.getByAddress(null,inet6Address.getAddress(),((Inet6Address)address).getScopeId());
            possibleAddresses.addFirst(newAddress);
          }
        }
      }
    }
 catch (    IOException ignored) {
    }
    if (possibleAddresses.isEmpty()) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + inet6Address);
    }
    return possibleAddresses;
  }
  return Collections.singleton(inet6Address);
}

Fixed version (ground truth):
public static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address){
  if ((inet6Address.isSiteLocalAddress() || inet6Address.isLinkLocalAddress()) && inet6Address.getScopeId() <= 0 && inet6Address.getScopedInterface() == null) {
    final LinkedList<Inet6Address> possibleAddresses=new LinkedList<Inet6Address>();
    try {
      final Enumeration<NetworkInterface> interfaces=NetworkInterface.getNetworkInterfaces();
      while (interfaces.hasMoreElements()) {
        NetworkInterface ni=interfaces.nextElement();
        Enumeration<InetAddress> addresses=ni.getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress address=addresses.nextElement();
          if (address instanceof Inet4Address) {
            continue;
          }
          if (inet6Address.isLinkLocalAddress() && address.isLinkLocalAddress() || inet6Address.isSiteLocalAddress() && address.isSiteLocalAddress()) {
            final Inet6Address newAddress=Inet6Address.getByAddress(null,inet6Address.getAddress(),((Inet6Address)address).getScopeId());
            possibleAddresses.addFirst(newAddress);
          }
        }
      }
    }
 catch (    IOException ignored) {
    }
    if (possibleAddresses.isEmpty()) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + inet6Address);
    }
    return possibleAddresses;
  }
  return Collections.singleton(inet6Address);
}
Program: 49472
Project: 49472
Buggy source:
public boolean returnRedoResponse(Request request,RedoType redoType){
  logRedo(request,redoType,false);
  request.clearForResponse();
  request.response=OBJECT_REDO;
  return returnResponse(request,null,redoType);
}

Fixed version (ground truth):
public boolean returnRedoResponse(Request request,RedoType redoType){
  setRedoResponse(request,redoType);
  return returnResponse(request,null);
}
Program: 49473
Project: 49473
Buggy source:
public Object putFromLoad(String name,Object key,Object value){
  return txnalPut(CONCURRENT_MAP_PUT_FROM_LOAD,name,key,value,-1,-1);
}

Fixed version (ground truth):
public Object putFromLoad(String name,Object key,Object value){
  return txnalPut(CONCURRENT_MAP_PUT_FROM_LOAD,name,key,value,0,-1);
}
Program: 49474
Project: 49474
Buggy source:
private Connection searchForAvailableConnection(){
  Connection connection=null;
  popAndPush(clusterMembers);
  int counter=clusterMembers.size();
  while (counter > 0) {
    try {
      connection=getNextConnection();
      break;
    }
 catch (    Exception e) {
      logger.log(Level.FINEST,e.getMessage(),e);
      popAndPush(clusterMembers);
      counter--;
    }
  }
  logger.log(Level.FINEST,format("String_Node_Str",connection));
  return connection;
}

Fixed version (ground truth):
private Connection searchForAvailableConnection(){
  Connection connection=null;
  popAndPush(clusterMembers);
  if (clusterMembers.isEmpty()) {
    clusterMembers.addAll(initialClusterMembers);
  }
  int counter=clusterMembers.size();
  while (counter > 0) {
    try {
      connection=getNextConnection();
      break;
    }
 catch (    Exception e) {
      logger.log(Level.FINEST,e.getMessage(),e);
      popAndPush(clusterMembers);
      counter--;
    }
  }
  logger.log(Level.FINEST,format("String_Node_Str",connection));
  return connection;
}
Program: 49475
Project: 49475
Buggy source:
public ConnectionManager(HazelcastClient client,ClientConfig config,LifecycleServiceClientImpl lifecycleService){
  this.config=config;
  this.client=client;
  this.lifecycleService=lifecycleService;
  this.clusterMembers.addAll(config.getAddressList());
  if (config.isShuffle()) {
    Collections.shuffle(this.clusterMembers);
  }
}

Fixed version (ground truth):
public ConnectionManager(HazelcastClient client,ClientConfig config,LifecycleServiceClientImpl lifecycleService){
  this.config=config;
  this.client=client;
  this.lifecycleService=lifecycleService;
  this.clusterMembers.addAll(config.getAddressList());
  this.initialClusterMembers.addAll(config.getAddressList());
  if (config.isShuffle()) {
    Collections.shuffle(this.clusterMembers);
    Collections.shuffle(this.initialClusterMembers);
  }
}
Program: 49476
Project: 49476
Buggy source:
public void memberAdded(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.addAll(addresses);
}

Fixed version (ground truth):
public void memberAdded(MembershipEvent membershipEvent){
  InetSocketAddress address=membershipEvent.getMember().getInetSocketAddress();
  Collection<InetSocketAddress> addresses=AddressHelper.getPossibleSocketAddresses(address.getAddress(),address.getPort());
  clusterMembers.addAll(addresses);
  initialClusterMembers.addAll(addresses);
}
Program: 49479
Project: 49479
Buggy source:
public final long getStartTime(){
  return joinStartTime;
}

Fixed version (ground truth):
public final long getStartTime(){
  return joinStartTime.get();
}
Program: 49480
Project: 49480
Buggy source:
public AbstractJoiner(Node node){
  this.node=node;
  this.systemLogService=node.getSystemLogService();
  if (node.loggingService != null) {
    this.logger=node.loggingService.getLogger(this.getClass().getName());
  }
  this.config=node.config;
}

Fixed version (ground truth):
public AbstractJoiner(Node node){
  this.node=node;
  this.systemLogService=node.getSystemLogService();
  this.logger=node.loggingService.getLogger(this.getClass().getName());
  this.config=node.config;
}
Program: 49481
Project: 49481
Buggy source:
private Address findMasterWithMulticast(){
  try {
    final String ip=System.getProperty("String_Node_Str");
    if (ip == null) {
      JoinInfo joinInfo=node.createJoinInfo();
      for (; node.isActive() && currentTryCount.incrementAndGet() <= tryCount.get(); ) {
        joinInfo.setTryCount(currentTryCount.get());
        node.multicastService.send(joinInfo);
        if (node.getMasterAddress() == null) {
          Thread.sleep(10);
        }
 else {
          return node.getMasterAddress();
        }
      }
    }
 else {
      logger.log(Level.FINEST,"String_Node_Str");
      return new Address(ip,config.getPort());
    }
  }
 catch (  final Exception e) {
    if (logger != null) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 finally {
    this.currentTryCount.set(0);
  }
  return null;
}

Fixed version (ground truth):
private Address findMasterWithMulticast(){
  try {
    final String ip=System.getProperty("String_Node_Str");
    if (ip == null) {
      JoinInfo joinInfo=node.createJoinInfo();
      for (; node.isActive() && currentTryCount.incrementAndGet() <= maxTryCount.get(); ) {
        joinInfo.setTryCount(currentTryCount.get());
        node.multicastService.send(joinInfo);
        if (node.getMasterAddress() == null) {
          Thread.sleep(10);
        }
 else {
          return node.getMasterAddress();
        }
      }
    }
 else {
      logger.log(Level.FINEST,"String_Node_Str");
      return new Address(ip,config.getPort());
    }
  }
 catch (  final Exception e) {
    if (logger != null) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 finally {
    this.currentTryCount.set(0);
  }
  return null;
}
Program: 49482
Project: 49482
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final BlockingQueue q=new LinkedBlockingQueue();
  MulticastListener listener=new MulticastListener(){
    public void onMessage(    Object msg){
      systemLogService.logJoin("String_Node_Str" + msg);
      if (msg != null && msg instanceof JoinInfo) {
        JoinInfo joinInfo=(JoinInfo)msg;
        if (node.address != null && !node.address.equals(joinInfo.address)) {
          q.offer(msg);
        }
      }
    }
  }
;
  node.multicastService.addMulticastListener(listener);
  node.multicastService.send(node.createJoinInfo());
  systemLogService.logJoin("String_Node_Str");
  try {
    JoinInfo joinInfo=(JoinInfo)q.poll(3,TimeUnit.SECONDS);
    if (joinInfo != null) {
      if (joinInfo.getMemberCount() == 1) {
        Thread.sleep(node.groupProperties.WAIT_SECONDS_BEFORE_JOIN.getInteger() * 1000L * 2);
      }
      if (shouldMerge(joinInfo)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + joinInfo.address);
        targetAddress=joinInfo.address;
        node.clusterManager.sendClusterMergeToOthers(targetAddress);
        node.factory.restart();
        return;
      }
    }
  }
 catch (  InterruptedException ignored) {
  }
catch (  Exception e) {
    if (logger != null) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 finally {
    node.multicastService.removeMulticastListener(listener);
  }
}

Fixed version (ground truth):
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final BlockingQueue q=new LinkedBlockingQueue();
  MulticastListener listener=new MulticastListener(){
    public void onMessage(    Object msg){
      systemLogService.logJoin("String_Node_Str" + msg);
      if (msg != null && msg instanceof JoinInfo) {
        JoinInfo joinInfo=(JoinInfo)msg;
        if (node.address != null && !node.address.equals(joinInfo.address)) {
          q.offer(msg);
        }
      }
    }
  }
;
  node.multicastService.addMulticastListener(listener);
  node.multicastService.send(node.createJoinInfo());
  systemLogService.logJoin("String_Node_Str");
  try {
    JoinInfo joinInfo=(JoinInfo)q.poll(3,TimeUnit.SECONDS);
    if (joinInfo != null) {
      if (joinInfo.getMemberCount() == 1) {
        Thread.sleep(node.groupProperties.WAIT_SECONDS_BEFORE_JOIN.getInteger() * 1000L * 2);
      }
      if (shouldMerge(joinInfo)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + joinInfo.address);
        targetAddress=joinInfo.address;
        node.clusterManager.sendClusterMergeToOthers(targetAddress);
        splitBrainHandler.restart();
        return;
      }
    }
  }
 catch (  InterruptedException ignored) {
  }
catch (  Exception e) {
    if (logger != null) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 finally {
    node.multicastService.removeMulticastListener(listener);
  }
}
Program: 49483
Project: 49483
Buggy source:
public void onReceivedJoinInfo(JoinInfo joinInfo){
  if (joinInfo.getTryCount() > this.currentTryCount.get() + 20) {
    int timeoutSeconds=(config.getNetworkConfig().getJoin().getMulticastConfig().getMulticastTimeoutSeconds() + 4) * 100;
    this.tryCount.set(timeoutSeconds);
  }
}

Fixed version (ground truth):
public void onReceivedJoinInfo(JoinInfo joinInfo){
  if (joinInfo.getTryCount() > this.currentTryCount.get() + 20) {
    int timeoutSeconds=(config.getNetworkConfig().getJoin().getMulticastConfig().getMulticastTimeoutSeconds() + 4) * 100;
    this.maxTryCount.set(timeoutSeconds);
  }
}
Program: 49484
Project: 49484
Buggy source:
public MulticastJoiner(Node node){
  super(node);
  tryCount=new AtomicInteger(calculateTryCount());
}

Fixed version (ground truth):
public MulticastJoiner(Node node){
  super(node);
  maxTryCount=new AtomicInteger(calculateTryCount());
}
Program: 49485
Project: 49485
Buggy source:
void join(){
  final long joinStartTime=joiner != null ? joiner.getStartTime() : Clock.currentTimeMillis();
  final long maxJoinMillis=getGroupProperties().MAX_JOIN_SECONDS.getInteger() * 1000;
  try {
    if (joiner == null) {
      logger.log(Level.WARNING,"String_Node_Str");
      setAsMaster();
    }
 else {
      joiner.join(joined);
    }
  }
 catch (  Exception e) {
    if (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis) {
      logger.log(Level.WARNING,e.getMessage());
      rejoin();
    }
 else {
      logger.log(Level.SEVERE,e.getMessage(),e);
      shutdown(false,true);
    }
  }
}

Fixed version (ground truth):
void join(){
  final long joinStartTime=joiner != null ? joiner.getStartTime() : Clock.currentTimeMillis();
  final long maxJoinMillis=getGroupProperties().MAX_JOIN_SECONDS.getInteger() * 1000;
  try {
    if (joiner == null) {
      logger.log(Level.WARNING,"String_Node_Str");
      setAsMaster();
    }
 else {
      joiner.join(joined);
    }
  }
 catch (  Exception e) {
    if (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis) {
      logger.log(Level.WARNING,e.getMessage());
      rejoin();
    }
 else {
      logger.log(Level.SEVERE,"String_Node_Str",e);
      shutdown(false,true);
    }
  }
}
Program: 49486
Project: 49486
Buggy source:
public void onRestart(){
  joined.set(false);
  final String uuid=UUID.randomUUID().toString();
  logger.log(Level.FINEST,"String_Node_Str" + uuid);
  localMember.setUuid(uuid);
}

Fixed version (ground truth):
public void onRestart(){
  joined.set(false);
  joiner.reset();
  final String uuid=UUID.randomUUID().toString();
  logger.log(Level.FINEST,"String_Node_Str" + uuid);
  localMember.setUuid(uuid);
}
Program: 49487
Project: 49487
Buggy source:
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      if (interfaces.isEnabled()) {
        final InetAddress[] inetAddresses=InetAddress.getAllByName(addressHolder.address);
        if (inetAddresses.length > 1) {
          for (          InetAddress inetAddress : inetAddresses) {
            if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
              return new Address(inetAddress,addressHolder.port);
            }
          }
        }
 else {
          final InetAddress inetAddress=inetAddresses[0];
          if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
            return new Address(addressHolder.address,addressHolder.port);
          }
        }
      }
 else {
        return new Address(addressHolder.address,addressHolder.port);
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}
Program: 49488
Project: 49488
Buggy source:
private void joinViaTargetMember(AtomicBoolean joined,Address targetAddress,long maxJoinMillis){
  try {
    logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
    if (targetAddress == null) {
      throw new RuntimeException("String_Node_Str" + targetAddress);
    }
    if (targetAddress.equals(node.address)) {
      node.setAsMaster();
      return;
    }
    long joinStartTime=Clock.currentTimeMillis();
    Connection connection=null;
    node.getFailedConnections().clear();
    while (node.isActive() && !joined.get() && (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
      connection=node.connectionManager.getOrConnect(targetAddress);
      if (connection == null) {
        if (node.getFailedConnections().contains(targetAddress)) {
          break;
        }
        Thread.sleep(2000L);
        continue;
      }
      logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
      node.clusterManager.sendJoinRequest(targetAddress,true);
      Thread.sleep(3000L);
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void joinViaTargetMember(AtomicBoolean joined,Address targetAddress,long maxJoinMillis){
  try {
    logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
    if (targetAddress == null) {
      throw new RuntimeException("String_Node_Str" + targetAddress);
    }
    if (targetAddress.equals(node.address) || isLocalAddress(targetAddress)) {
      node.setAsMaster();
      return;
    }
    long joinStartTime=Clock.currentTimeMillis();
    Connection connection=null;
    node.getFailedConnections().clear();
    while (node.isActive() && !joined.get() && (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
      connection=node.connectionManager.getOrConnect(targetAddress);
      if (connection == null) {
        if (node.getFailedConnections().contains(targetAddress)) {
          break;
        }
        Thread.sleep(2000L);
        continue;
      }
      logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
      node.clusterManager.sendJoinRequest(targetAddress,true);
      Thread.sleep(3000L);
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
}
Program: 49489
Project: 49489
Buggy source:
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final InetAddress[] allAddresses=InetAddress.getAllByName(addressHolder.address);
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      for (      final InetAddress inetAddress : allAddresses) {
        boolean matchingAddress=true;
        if (interfaces.isEnabled()) {
          matchingAddress=AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces());
        }
        if (matchingAddress) {
          return new Address(inetAddress,addressHolder.port);
        }
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
private Address getAddressFor(String host){
  try {
    final AddressHolder addressHolder=AddressUtil.getAddressHolder(host,config.getPort());
    if (AddressUtil.isIpAddress(addressHolder.address)) {
      return new Address(addressHolder.address,addressHolder.port);
    }
 else {
      final Interfaces interfaces=config.getNetworkConfig().getInterfaces();
      if (interfaces.isEnabled()) {
        final InetAddress[] inetAddresses=InetAddress.getAllByName(addressHolder.address);
        if (inetAddresses.length > 1) {
          for (          InetAddress inetAddress : inetAddresses) {
            if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
              return new Address(inetAddress,addressHolder.port);
            }
          }
        }
 else {
          final InetAddress inetAddress=inetAddresses[0];
          if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),interfaces.getInterfaces())) {
            return new Address(addressHolder.address,addressHolder.port);
          }
        }
      }
 else {
        return new Address(addressHolder.address,addressHolder.port);
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
  return null;
}
Program: 49490
Project: 49490
Buggy source:
private void joinViaTargetMember(AtomicBoolean joined,Address targetAddress,long maxJoinMillis){
  try {
    logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
    if (targetAddress == null) {
      throw new RuntimeException("String_Node_Str" + targetAddress);
    }
    if (targetAddress.equals(node.address)) {
      node.setAsMaster();
      return;
    }
    long joinStartTime=Clock.currentTimeMillis();
    Connection connection=null;
    node.getFailedConnections().clear();
    while (node.isActive() && !joined.get() && (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
      connection=node.connectionManager.getOrConnect(targetAddress);
      if (connection == null) {
        if (node.getFailedConnections().contains(targetAddress)) {
          break;
        }
        Thread.sleep(2000L);
        continue;
      }
      logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
      node.clusterImpl.sendJoinRequest(targetAddress,true);
      Thread.sleep(3000L);
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void joinViaTargetMember(AtomicBoolean joined,Address targetAddress,long maxJoinMillis){
  try {
    logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
    if (targetAddress == null) {
      throw new RuntimeException("String_Node_Str" + targetAddress);
    }
    if (targetAddress.equals(node.address) || isLocalAddress(targetAddress)) {
      node.setAsMaster();
      return;
    }
    long joinStartTime=Clock.currentTimeMillis();
    Connection connection=null;
    node.getFailedConnections().clear();
    while (node.isActive() && !joined.get() && (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
      connection=node.connectionManager.getOrConnect(targetAddress);
      if (connection == null) {
        if (node.getFailedConnections().contains(targetAddress)) {
          break;
        }
        Thread.sleep(2000L);
        continue;
      }
      logger.log(Level.FINEST,"String_Node_Str" + targetAddress);
      node.clusterImpl.sendJoinRequest(targetAddress,true);
      Thread.sleep(3000L);
    }
  }
 catch (  final Exception e) {
    logger.log(Level.WARNING,e.getMessage(),e);
  }
}
Program: 49492
Project: 49492
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
        return;
      }
 else {
        conn.close();
      }
    }
  }
}

Fixed version (ground truth):
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
        return;
      }
    }
  }
}
Program: 49494
Project: 49494
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
        return;
      }
 else {
        conn.close();
      }
    }
  }
}

Fixed version (ground truth):
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
        return;
      }
    }
  }
}
Program: 49495
Project: 49495
Buggy source:
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.size() == 0) {
    return;
  }
  for (  final Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
      }
      return;
    }
  }
}

Fixed version (ground truth):
public void searchForOtherClusters(SplitBrainHandler splitBrainHandler){
  final Collection<Address> colPossibleAddresses;
  try {
    colPossibleAddresses=getPossibleAddresses();
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    return;
  }
  colPossibleAddresses.remove(node.getThisAddress());
  for (  Member member : node.getClusterImpl().getMembers()) {
    colPossibleAddresses.remove(((MemberImpl)member).getAddress());
  }
  if (colPossibleAddresses.isEmpty()) {
    return;
  }
  for (  Address possibleAddress : colPossibleAddresses) {
    logger.log(Level.FINEST,node.getThisAddress() + "String_Node_Str" + possibleAddress);
    node.connectionManager.getOrConnect(possibleAddress,true);
    try {
      Thread.sleep(1500);
    }
 catch (    InterruptedException e) {
      return;
    }
    final Connection conn=node.connectionManager.getConnection(possibleAddress);
    if (conn != null) {
      final JoinInfo response=node.clusterManager.checkJoin(conn);
      if (response != null && shouldMerge(response)) {
        logger.log(Level.WARNING,node.address + "String_Node_Str" + possibleAddress);
        splitBrainHandler.restart();
        return;
      }
 else {
        conn.close();
      }
    }
  }
}