Buggy code:
public class StorageService implements IEndpointStateChangeSubscriber , StorageServiceMBean { private static Logger logger_ = LoggerFactory . getLogger ( StorageService . class ) ; public static final int RING_DELAY = 30 * 1000 ; public enum Verb { MUTATION , BINARY , READ_REPAIR , READ , REQUEST_RESPONSE , STREAM_INITIATE , STREAM_INITIATE_DONE , STREAM_REPLY , STREAM_REQUEST , RANGE_SLICE , BOOTSTRAP_TOKEN , TREE_REQUEST , TREE_RESPONSE , JOIN , GOSSIP_DIGEST_SYN , GOSSIP_DIGEST_ACK , GOSSIP_DIGEST_ACK2 , DEFINITIONS_ANNOUNCE , DEFINITIONS_UPDATE , TRUNCATE , SCHEMA_CHECK , INDEX_SCAN , REPLICATION_FINISHED , INTERNAL_RESPONSE , COUNTER_MUTATION , UNUSED_1 , UNUSED_2 , UNUSED_3 ; } public static final StorageService . Verb [ ] VERBS = StorageService . Verb . values ( ) ; public static final EnumMap < StorageService . Verb , Stage > verbStages = new EnumMap < StorageService . Verb , Stage > ( StorageService . Verb . class ) { } ; public static final RetryingScheduledThreadPoolExecutor scheduledTasks = new RetryingScheduledThreadPoolExecutor ( "ScheduledTasks" ) ; public static final RetryingScheduledThreadPoolExecutor tasks = new RetryingScheduledThreadPoolExecutor ( "NonPeriodicTasks" ) ; private TokenMetadata tokenMetadata_ = new TokenMetadata ( ) ; private IPartitioner partitioner = DatabaseDescriptor . getPartitioner ( ) ; public VersionedValueFactory valueFactory = new VersionedValue . VersionedValueFactory ( partitioner ) ; public static final StorageService instance = new StorageService ( ) ; public static IPartitioner getPartitioner ( ) { } public Collection < Range > getLocalRanges ( String table ) { } public Range getLocalPrimaryRange ( ) { } private Set < InetAddress > replicatingNodes = Collections . synchronizedSet ( new HashSet < InetAddress > ( ) ) ; private CassandraDaemon daemon ; private InetAddress removingNode ; private boolean isBootstrapMode ; private boolean isClientMode ; private boolean initialized ; private volatile boolean joined = false ; private String operationMode ; private MigrationManager migrationManager = new MigrationManager ( ) ; private volatile int totalCFs ; private volatile int remainingCFs ; private static final AtomicInteger nextRepairCommand = new AtomicInteger ( ) ; public void finishBootstrapping ( ) { } public void setToken ( Token token ) { } public StorageService ( ) { } public void registerDaemon ( CassandraDaemon daemon ) { } public void stopGossiping ( ) { } public void startGossiping ( ) { } public void startRPCServer ( ) { } public void stopRPCServer ( ) { } public boolean isRPCServerRunning ( ) { } public void stopClient ( ) { } public boolean isInitialized ( ) { } public synchronized void initClient ( ) throws IOException , ConfigurationException { } public synchronized void initClient ( int delay ) throws IOException , ConfigurationException { } public synchronized void initServer ( ) throws IOException , ConfigurationException { StorageService . logger_ . info ( ( "Cassandra<seq2seq4repair_space>version:<seq2seq4repair_space>" + ( FBUtilities . getReleaseVersionString ( ) ) ) ) ; StorageService . logger_ . info ( ( "Thrift<seq2seq4repair_space>API<seq2seq4repair_space>version:<seq2seq4repair_space>" + ( Constants . VERSION ) ) ) ; if ( initialized ) { if ( isClientMode ) throw new UnsupportedOperationException ( "StorageService<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>switching<seq2seq4repair_space>modes." ) ; return ; } initialized = true ; isClientMode = false ; if ( Boolean . parseBoolean ( System . getProperty ( "cassandra.load_ring_state" , "true" ) ) ) { StorageService . logger_ . info ( "Loading<seq2seq4repair_space>persisted<seq2seq4repair_space>ring<seq2seq4repair_space>state" ) ; for ( Map . Entry < Token , InetAddress > entry : SystemTable . loadTokens ( ) . entrySet ( ) ) { <START_BUG> if ( ( entry . getValue ( ) ) == ( FBUtilities . getBroadcastAddress ( ) ) ) { <END_BUG> SystemTable . removeToken ( entry . getKey ( ) ) ; } else { tokenMetadata_ . updateNormalToken ( entry . getKey ( ) , entry . getValue ( ) ) ; Gossiper . instance . addSavedEndpoint ( entry . getValue ( ) ) ; } } } if ( Boolean . parseBoolean ( System . getProperty ( "cassandra.renew_counter_id" , "false" ) ) ) { StorageService . logger_ . info ( "Renewing<seq2seq4repair_space>local<seq2seq4repair_space>node<seq2seq4repair_space>id<seq2seq4repair_space>(as<seq2seq4repair_space>requested)" ) ; NodeId . renewLocalId ( ) ; } Thread drainOnShutdown = new Thread ( new WrappedRunnable ( ) { public void runMayThrow ( ) throws IOException , InterruptedException , ExecutionException { ThreadPoolExecutor mutationStage = StageManager . getStage ( MUTATION ) ; if ( mutationStage . isShutdown ( ) ) return ; mutationStage . shutdown ( ) ; mutationStage . awaitTermination ( 1 , TimeUnit . SECONDS ) ; List < Future < ? > > flushes = new ArrayList < Future < ? > > ( ) ; for ( Table table : Table . all ( Table ) ) { KSMetaData ksm = DatabaseDescriptor . getKSMetaData ( table . name ) ; if ( ! ( ksm . durableWrites ) ) { for ( ColumnFamilyStore cfs : table . getColumnFamilyStores ( ) ) { Future < ? > future = cfs . forceFlush ( ) ; if ( future != null ) flushes . add ( future ) ; } } } FBUtilities . waitOnFutures ( flushes ) ; CommitLog . instance . shutdownBlocking ( ) ; } } ) ; Runtime . getRuntime ( ) . addShutdownHook ( drainOnShutdown ) ; if ( Boolean . parseBoolean ( System . getProperty ( "cassandra.join_ring" , "true" ) ) ) { joinTokenRing ( ) ; } else { StorageService . logger_ . info ( "Not<seq2seq4repair_space>joining<seq2seq4repair_space>ring<seq2seq4repair_space>as<seq2seq4repair_space>requested.<seq2seq4repair_space>Use<seq2seq4repair_space>JMX<seq2seq4repair_space>(StorageService->joinRing())<seq2seq4repair_space>to<seq2seq4repair_space>initiate<seq2seq4repair_space>ring<seq2seq4repair_space>joining" ) ; } } private void joinTokenRing ( ) throws IOException , ConfigurationException { } public synchronized void joinRing ( ) throws IOException , ConfigurationException { } public boolean isJoined ( ) { } public int getCompactionThroughputMbPerSec ( ) { } public void setCompactionThroughputMbPerSec ( int value ) { } private void setMode ( String m , boolean log ) { } private void bootstrap ( Token token ) throws IOException { } public boolean isBootstrapMode ( ) { } public TokenMetadata getTokenMetadata ( ) { } public Map < Range , List < String > > getRangeToEndpointMap ( String keyspace ) { } public String getRpcaddress ( InetAddress endpoint ) { } public Map < Range , List < String > > getRangeToRpcaddressMap ( String keyspace ) { }

Fix:
if ( ( entry . getValue ( ) ) == ( FBUtilities . getLocalAddress ( ) ) ) {