Source:
public CacheStatusResponse doJoin(Address joiner, CacheJoinInfo joinInfo) throws Exception { boolean isFirstMember; CacheTopology topologyBeforeRebalance; synchronized (this) { isFirstMember = getCurrentTopology() == null; boolean memberJoined = addMember(joiner, joinInfo); if (!isFirstMember && !memberJoined) { if (trace) log.tracef("Trying to add node %s to cache %s, but it is already a member: " + "members = %s, joiners = %s", joiner, cacheName, expectedMembers, joiners); return new CacheStatusResponse(null, currentTopology, stableTopology, availabilityMode); } if (status == ComponentStatus.INSTANTIATED) { if (persistentState.isPresent()) { if (trace) log.tracef("Node %s joining. Attempting to reform previous cluster", joiner); CacheTopology topology = restoreCacheTopology(persistentState.get(), joinInfo.getPersistentStateChecksum()); if (topology != null) { status = ComponentStatus.RUNNING; clusterTopologyManager.broadcastTopologyUpdate(cacheName, topology, availabilityMode, isTotalOrder(), isDistributed()); clusterTopologyManager.broadcastStableTopologyUpdate(cacheName, topology, isTotalOrder(), isDistributed()); return new CacheStatusResponse(null, currentTopology, stableTopology, availabilityMode); } } else { if (isFirstMember) { CacheTopology initialTopology = createInitialCacheTopology(); status = ComponentStatus.RUNNING; clusterTopologyManager.broadcastStableTopologyUpdate(cacheName, initialTopology, isTotalOrder(), isDistributed()); } } } topologyBeforeRebalance = getCurrentTopology(); if (topologyBeforeRebalance != null) availabilityStrategy.onJoin(this, joiner); } return new CacheStatusResponse(null, topologyBeforeRebalance, stableTopology, availabilityMode); }

Target:
public CacheStatusResponse doJoin(Address joiner, CacheJoinInfo joinInfo) throws Exception { boolean isFirstMember; CacheTopology topologyBeforeRebalance; synchronized (this) { isFirstMember = getCurrentTopology() == null; boolean memberJoined = addMember(joiner, joinInfo); if (!isFirstMember && !memberJoined) { if (trace) log.tracef("Trying to add node %s to cache %s, but it is already a member: " + "members = %s, joiners = %s", joiner, cacheName, expectedMembers, joiners); return new CacheStatusResponse(null, currentTopology, stableTopology, availabilityMode); } if (status == ComponentStatus.INSTANTIATED) { if (persistentState.isPresent()) { if (trace) log.tracef("Node %s joining. Attempting to reform previous cluster", joiner); CacheTopology topology = restoreCacheTopology(persistentState.get()); if (topology != null) { status = ComponentStatus.RUNNING; clusterTopologyManager.broadcastTopologyUpdate(cacheName, topology, availabilityMode, isTotalOrder(), isDistributed()); clusterTopologyManager.broadcastStableTopologyUpdate(cacheName, topology, isTotalOrder(), isDistributed()); return new CacheStatusResponse(null, currentTopology, stableTopology, availabilityMode); } } else { if (isFirstMember) { CacheTopology initialTopology = createInitialCacheTopology(); status = ComponentStatus.RUNNING; clusterTopologyManager.broadcastStableTopologyUpdate(cacheName, initialTopology, isTotalOrder(), isDistributed()); } } } topologyBeforeRebalance = getCurrentTopology(); if (topologyBeforeRebalance != null) availabilityStrategy.onJoin(this, joiner); } return new CacheStatusResponse(null, topologyBeforeRebalance, stableTopology, availabilityMode); }