Source:
<code>public BoundState bindToCluster() throws Throwable { if ( dbNameStorage.exists() ) <START> { <END> String storedName = dbNameStorage.readState().name(); if ( !dbName.equals( storedName ) ) { throw new IllegalStateException( format("Your configured database name may have changed. Found %s, expected %s", dbName, storedName ) ); } } else { dbNameStorage.writeState( new DatabaseName( dbName ) ); } if ( clusterIdStorage.exists() ) { clusterId = clusterIdStorage.readState(); publishClusterId( clusterId ); log.info( "Already bound to cluster: " + clusterId ); return new BoundState( clusterId ); } CoreSnapshot snapshot = null; CoreTopology topology; long endTime = clock.millis() + timeoutMillis; do { topology = topologyService.localCoreServers(); if ( topology.clusterId() != null ) { clusterId = topology.clusterId(); log.info( "Bound to cluster: " + clusterId ); } else if ( hostShouldBootstrapCluster( topology ) ) { clusterId = new ClusterId( UUID.randomUUID() ); snapshot = coreBootstrapper.bootstrap( topology.members().keySet() ); log.info( format( "Bootstrapped with snapshot: %s and clusterId: %s", snapshot, clusterId ) ); publishClusterId( clusterId ); } else { retryWaiter.apply(); } } while ( clusterId == null && clock.millis() < endTime ); if ( clusterId == null ) { throw new TimeoutException( format( "Failed to join a cluster with members %s. Another member should have published " + "a clusterId but none was detected. Please restart the cluster.", topology ) ); } clusterIdStorage.writeState( clusterId ); return new BoundState( clusterId, snapshot ); }</code><technical_language>odd newlines beginning of some methods classes. Do is introduced code style settings</technical_language>

Target:
public BoundState bindToCluster() throws Throwable { DatabaseName newName = new DatabaseName( dbName ); dbNameStorage.writeOrVerify( newName, existing -> { if ( !newName.equals( existing ) ) { throw new IllegalStateException( format("Your configured database name has changed. Found %s but expected %s in %s.", dbName, existing.name(), CausalClusteringSettings.database.name() ) ); } } ); if ( clusterIdStorage.exists() ) { clusterId = clusterIdStorage.readState(); publishClusterId( clusterId ); log.info( "Already bound to cluster: " + clusterId ); return new BoundState( clusterId ); } CoreSnapshot snapshot = null; CoreTopology topology; long endTime = clock.millis() + timeoutMillis; do { topology = topologyService.localCoreServers(); if ( topology.clusterId() != null ) { clusterId = topology.clusterId(); log.info( "Bound to cluster: " + clusterId ); } else if ( hostShouldBootstrapCluster( topology ) ) { clusterId = new ClusterId( UUID.randomUUID() ); snapshot = coreBootstrapper.bootstrap( topology.members().keySet() ); log.info( format( "Bootstrapped with snapshot: %s and clusterId: %s", snapshot, clusterId ) ); publishClusterId( clusterId ); } else { retryWaiter.apply(); } } while ( clusterId == null && clock.millis() < endTime ); if ( clusterId == null ) { throw new TimeoutException( format( "Failed to join a cluster with members %s. Another member should have published " + "a clusterId but none was detected. Please restart the cluster.", topology ) ); } clusterIdStorage.writeState( clusterId ); return new BoundState( clusterId, snapshot ); }