Buggy code:
private ThreadLocal < AccessLevel > loginDone = new ThreadLocal < AccessLevel > ( ) { @ Override protected AccessLevel initialValue ( ) { } } ; private ThreadLocal < String > keySpace = new ThreadLocal < String > ( ) ; private ThreadLocal < String > requestSchedulerId = new ThreadLocal < String > ( ) ; private final IRequestScheduler requestScheduler ; private final StorageService storageService ; public CassandraServer ( ) { } protected Map < DecoratedKey , ColumnFamily > readColumnFamily ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public List < Column > thriftifySubColumns ( Collection < IColumn > columns ) { } public List < ColumnOrSuperColumn > thriftifyColumns ( Collection < IColumn > columns , boolean reverseOrder ) { } private List < ColumnOrSuperColumn > thriftifySuperColumns ( Collection < IColumn > columns , boolean reverseOrder ) { } private static Clock thriftifyIClock ( IClock clock ) { } private Map < byte [ ] , List < ColumnOrSuperColumn > > getSlice ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } private List < ColumnOrSuperColumn > thriftifyColumnFamily ( ColumnFamily cf , boolean subcolumnsOnly , boolean reverseOrder ) { } public List < ColumnOrSuperColumn > get_slice ( byte [ ] key , ColumnParent column_parent , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public Map < byte [ ] , List < ColumnOrSuperColumn > > multiget_slice ( List < byte [ ] > keys , ColumnParent column_parent , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } private Map < byte [ ] , List < ColumnOrSuperColumn > > multigetSliceInternal ( String keyspace , List < byte [ ] > keys , ColumnParent column_parent , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public ColumnOrSuperColumn get ( byte [ ] key , ColumnPath column_path , ConsistencyLevel consistency_level ) throws InvalidRequestException , NotFoundException , TimedOutException , UnavailableException { } public int get_count ( byte [ ] key , ColumnParent column_parent , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public Map < byte [ ] , Integer > multiget_count ( String table , List < byte [ ] > keys , ColumnParent column_parent , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public void insert ( byte [ ] key , ColumnParent column_parent , Column column , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public void batch_mutate ( Map < byte [ ] , Map < String , List < Mutation > > > mutation_map , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } public void remove ( byte [ ] key , ColumnPath column_path , Clock clock , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } private void doInsert ( ConsistencyLevel consistency_level , List < RowMutation > mutations ) throws TimedOutException , UnavailableException { } public Map < String , Map < String , String > > describe_keyspace ( String table ) throws NotFoundException { } public List < KeySlice > get_range_slices ( ColumnParent column_parent , SlicePredicate predicate , KeyRange range , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException , TException { } private List < KeySlice > getRangeSlicesInternal ( String keyspace , ColumnParent column_parent , KeyRange range , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException { } private List < KeySlice > thriftifyKeySlices ( List < Row > rows , ColumnParent column_parent , SlicePredicate predicate ) { } public List < KeySlice > scan ( ColumnParent column_parent , RowPredicate row_predicate , SlicePredicate column_predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException , TException { } private List < KeySlice > scanIndexInternal ( String keyspace , ColumnParent column_parent , IndexClause index_clause , SlicePredicate predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException { } public List < KeyCount > scan_count ( ColumnParent column_parent , RowPredicate row_predicate , SlicePredicate column_predicate , ConsistencyLevel consistency_level ) throws InvalidRequestException , TimedOutException , UnavailableException , TException { } public Set < String > describe_keyspaces ( ) throws TException { } public String describe_cluster_name ( ) throws TException { } public String describe_version ( ) throws TException { } public List < TokenRange > describe_ring ( String keyspace ) throws InvalidRequestException { <START_BUG> if ( ! ( DatabaseDescriptor . getNonSystemTables ( ) . contains ( keyspace ) ) ) <END_BUG> throw new InvalidRequestException ( ( "There<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>ring<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>keyspace:<seq2seq4repair_space>" + keyspace ) ) ; List < TokenRange > ranges = new ArrayList < TokenRange > ( ) ; Token . TokenFactory tf = StorageService . getPartitioner ( ) . getTokenFactory ( ) ; for ( Map . Entry < Range , List < String > > entry : instance . getRangeToEndpointMap ( keyspace ) . entrySet ( ) ) { Range range = entry . getKey ( ) ; List < String > endpoints = entry . getValue ( ) ; ranges . add ( new TokenRange ( tf . toString ( range . left ) , tf . toString ( range . right ) , endpoints ) ) ; } return ranges ; } public String describe_partitioner ( ) throws TException { } public List < String > describe_splits ( String keyspace , String cfName , String start_token , String end_token , int keys_per_split ) throws TException { } public AccessLevel login ( AuthenticationRequest auth_request ) throws AuthenticationException , AuthorizationException , TException { } public void logout ( ) { } protected void checkKeyspaceAndLoginAuthorized ( AccessLevel level ) throws InvalidRequestException { } private void schedule ( ) { } private void release ( ) { } private static void applyMigrationOnStage ( final Migration m ) throws InvalidRequestException { } public String system_add_column_family ( CfDef cf_def ) throws InvalidRequestException , TException { }

Fix:
if ( ( keyspace == null ) || ( ! ( DatabaseDescriptor . getNonSystemTables ( ) . contains ( keyspace ) ) ) )