Buggy code:
public static VersionedValueFactory valueFactory = new VersionedValue . VersionedValueFactory ( StorageService . partitioner_ ) ; public static RetryingScheduledThreadPoolExecutor scheduledTasks = new RetryingScheduledThreadPoolExecutor ( "ScheduledTasks" ) ; public static final StorageService instance = new StorageService ( ) ; public static IPartitioner getPartitioner ( ) { } public Collection < Range > getLocalRanges ( String table ) { } public Range getLocalPrimaryRange ( ) { } private TokenMetadata tokenMetadata_ = new TokenMetadata ( ) ; private ExecutorService consistencyManager_ = new org . apache . cassandra . concurrent . JMXEnabledThreadPoolExecutor ( DatabaseDescriptor . getConsistencyThreads ( ) , DatabaseDescriptor . getConsistencyThreads ( ) , StageManager . KEEPALIVE , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( ) , new NamedThreadFactory ( "ReadRepair" ) , "request" ) ; private Set < InetAddress > replicatingNodes ; private InetAddress removingNode ; private boolean isBootstrapMode ; private boolean isClientMode ; private boolean initialized ; private String operationMode ; private MigrationManager migrationManager = new MigrationManager ( ) ; private volatile int totalCFs ; private volatile int remainingCFs ; public void finishBootstrapping ( ) { } public void setToken ( Token token ) { } public StorageService ( ) { } public void stopClient ( ) { } public synchronized void initClient ( ) throws IOException { } 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 ; try { GCInspector . instance . start ( ) ; } catch ( Throwable t ) { StorageService . logger_ . warn ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>GCInspector<seq2seq4repair_space>(currently<seq2seq4repair_space>only<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>Sun<seq2seq4repair_space>JVM)" ) ; } if ( Boolean . valueOf ( 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 ( ) ) { tokenMetadata_ . updateNormalToken ( entry . getKey ( ) , entry . getValue ( ) ) ; Gossiper . instance . addSavedEndpoint ( entry . getValue ( ) ) ; } } StorageService . logger_ . info ( "Starting<seq2seq4repair_space>up<seq2seq4repair_space>server<seq2seq4repair_space>gossip" ) ; Gossiper . instance . register ( this ) ; Gossiper . instance . register ( migrationManager ) ; Gossiper . instance . start ( FBUtilities . getLocalAddress ( ) , SystemTable . incrementAndGetGeneration ( ) ) ; MessagingService . instance . listen ( FBUtilities . getLocalAddress ( ) ) ; StorageLoadBalancer . instance . startBroadcasting ( ) ; MigrationManager . announce ( DatabaseDescriptor . getDefsVersion ( ) , DatabaseDescriptor . getSeeds ( ) ) ; if ( ( ( DatabaseDescriptor . isAutoBootstrap ( ) ) && ( DatabaseDescriptor . getSeeds ( ) . contains ( FBUtilities . getLocalAddress ( ) ) ) ) && ( ! ( SystemTable . isBootstrapped ( ) ) ) ) StorageService . logger_ . info ( "This<seq2seq4repair_space>node<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>auto<seq2seq4repair_space>bootstrap<seq2seq4repair_space>because<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>configured<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>seed<seq2seq4repair_space>node." ) ; if ( ( DatabaseDescriptor . isAutoBootstrap ( ) ) && ( ! ( ( DatabaseDescriptor . getSeeds ( ) . contains ( FBUtilities . getLocalAddress ( ) ) ) || ( SystemTable . isBootstrapped ( ) ) ) ) ) { setMode ( "Joining:<seq2seq4repair_space>getting<seq2seq4repair_space>load<seq2seq4repair_space>information" , true ) ; StorageLoadBalancer . instance . waitForLoadInfo ( ) ; if ( StorageService . logger_ . isDebugEnabled ( ) ) StorageService . logger_ . debug ( "...<seq2seq4repair_space>got<seq2seq4repair_space>load<seq2seq4repair_space>info" ) ; if ( tokenMetadata_ . isMember ( FBUtilities . getLocalAddress ( ) ) ) { String s = "This<seq2seq4repair_space>node<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>a<seq2seq4repair_space>member<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>token<seq2seq4repair_space>ring;<seq2seq4repair_space>bootstrap<seq2seq4repair_space>aborted.<seq2seq4repair_space>(If<seq2seq4repair_space>replacing<seq2seq4repair_space>a<seq2seq4repair_space>dead<seq2seq4repair_space>node,<seq2seq4repair_space>remove<seq2seq4repair_space>the<seq2seq4repair_space>old<seq2seq4repair_space>one<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>ring<seq2seq4repair_space>first.)" ; throw new UnsupportedOperationException ( s ) ; } setMode ( "Joining:<seq2seq4repair_space>getting<seq2seq4repair_space>bootstrap<seq2seq4repair_space>token" , true ) ; Token token = BootStrapper . getBootstrapToken ( tokenMetadata_ , StorageLoadBalancer . instance . getLoadInfo ( ) ) ; if ( ( DatabaseDescriptor . getNonSystemTables ( ) . size ( ) ) > 0 ) { bootstrap ( token ) ; assert ! ( isBootstrapMode ) ; } else { isBootstrapMode = false ; SystemTable . setBootstrapped ( true ) ; <START_BUG> tokenMetadata_ . updateNormalToken ( token , FBUtilities . getLocalAddress ( ) ) ; <END_BUG> Gossiper . instance . addLocalApplicationState ( STATUS , StorageService . valueFactory . normal ( token ) ) ; setMode ( "Normal" , false ) ; } } else { Token token = SystemTable . getSavedToken ( ) ; if ( token == null ) { String initialToken = DatabaseDescriptor . getInitialToken ( ) ; if ( initialToken == null ) { token = StorageService . partitioner_ . getRandomToken ( ) ; StorageService . logger_ . warn ( ( ( "Generated<seq2seq4repair_space>random<seq2seq4repair_space>token<seq2seq4repair_space>" + token ) + ".<seq2seq4repair_space>Random<seq2seq4repair_space>tokens<seq2seq4repair_space>will<seq2seq4repair_space>result<seq2seq4repair_space>in<seq2seq4repair_space>an<seq2seq4repair_space>unbalanced<seq2seq4repair_space>ring;<seq2seq4repair_space>see<seq2seq4repair_space>http:////wiki.apache.org//cassandra//Operations" ) ) ; } else { token = StorageService . partitioner_ . getTokenFactory ( ) . fromString ( initialToken ) ; StorageService . logger_ . info ( ( ( "Saved<seq2seq4repair_space>token<seq2seq4repair_space>not<seq2seq4repair_space>found.<seq2seq4repair_space>Using<seq2seq4repair_space>" + token ) + "<seq2seq4repair_space>from<seq2seq4repair_space>configuration" ) ) ; } SystemTable . updateToken ( token ) ; } else { StorageService . logger_ . info ( ( "Using<seq2seq4repair_space>saved<seq2seq4repair_space>token<seq2seq4repair_space>" + token ) ) ; } SystemTable . setBootstrapped ( true ) ; tokenMetadata_ . updateNormalToken ( token , FBUtilities . getLocalAddress ( ) ) ; Gossiper . instance . addLocalApplicationState ( STATUS , StorageService . valueFactory . normal ( token ) ) ; setMode ( "Normal" , false ) ; } assert ( tokenMetadata_ . sortedTokens ( ) . size ( ) ) > 0 ; } private void setMode ( String m , boolean log ) { } private void bootstrap ( Token token ) throws IOException { } public boolean isBootstrapMode ( ) { } public TokenMetadata getTokenMetadata ( ) { } public void doConsistencyCheck ( Row row , List < InetAddress > endpoints , ReadCommand command ) { } public Map < Range , List < String > > getRangeToEndpointMap ( String keyspace ) { }

Fix:
setToken ( token ) ;