Buggy code:
public class ThriftValidation { private static Logger logger = LoggerFactory . getLogger ( ThriftValidation . class ) ; public static void validateKey ( CFMetaData metadata , ByteBuffer key ) throws InvalidRequestException { } public static void validateTable ( String tablename ) throws KeyspaceNotDefinedException { } public static void validateConsistencyLevel ( String table , ConsistencyLevel cl ) throws InvalidRequestException { } public static CFMetaData validateColumnFamily ( String tablename , String cfName , boolean isCommutativeOp ) throws InvalidRequestException { } public static CFMetaData validateColumnFamily ( String tablename , String cfName ) throws InvalidRequestException { } public static void validateColumnPath ( CFMetaData metadata , ColumnPath column_path ) throws InvalidRequestException { } public static void validateColumnParent ( CFMetaData metadata , ColumnParent column_parent ) throws InvalidRequestException { } static void validateColumnPathOrParent ( CFMetaData metadata , ColumnPath column_path_or_parent ) throws InvalidRequestException { } private static void validateColumnNames ( CFMetaData metadata , ByteBuffer superColumnName , Iterable < ByteBuffer > column_names ) throws InvalidRequestException { } public static void validateColumnNames ( CFMetaData metadata , ColumnParent column_parent , Iterable < ByteBuffer > column_names ) throws InvalidRequestException { } public static void validateRange ( CFMetaData metadata , ColumnParent column_parent , SliceRange range ) throws InvalidRequestException { } public static void validateColumnOrSuperColumn ( CFMetaData metadata , ColumnOrSuperColumn cosc ) throws InvalidRequestException { } private static void validateTtl ( Column column ) throws InvalidRequestException { } public static void validateMutation ( CFMetaData metadata , Mutation mut ) throws InvalidRequestException { } public static void validateDeletion ( CFMetaData metadata , Deletion del ) throws InvalidRequestException { } public static void validateSlicePredicate ( CFMetaData metadata , ByteBuffer scName , SlicePredicate predicate ) throws InvalidRequestException { } public static void validateColumnData ( CFMetaData metadata , Column column , boolean isSubColumn ) throws InvalidRequestException { } private static ByteBuffer summarize ( ByteBuffer buffer ) { } public static void validatePredicate ( CFMetaData metadata , ColumnParent column_parent , SlicePredicate predicate ) throws InvalidRequestException { } public static void validateKeyRange ( KeyRange range ) throws InvalidRequestException { } public static void validateIndexClauses ( CFMetaData metadata , IndexClause index_clause ) throws InvalidRequestException { } public static void validateCfDef ( CfDef cf_def , CFMetaData old ) throws InvalidRequestException { } public static void validateCommutativeForWrite ( CFMetaData metadata , ConsistencyLevel consistency ) throws InvalidRequestException { } public static void validateKsDef ( KsDef ks_def ) throws ConfigurationException { } public static void validateMinMaxCompactionThresholds ( org . apache . cassandra . thrift . CfDef cf_def ) throws ConfigurationException { } public static void validateMemtableSettings ( org . apache . cassandra . thrift . CfDef cf_def ) throws ConfigurationException { } public static void validateKeyspaceNotYetExisting ( String newKsName ) throws InvalidRequestException { <START_BUG> for ( String ksName : DatabaseDescriptor . getTables ( ) ) { <END_BUG> if ( ksName . equalsIgnoreCase ( newKsName ) ) throw new InvalidRequestException ( "Keyspace<seq2seq4repair_space>names<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>case-insensitively<seq2seq4repair_space>unique" ) ; } } }

Fix:
for ( String ksName : instance . getTables ( ) ) {