Buggy code:
public void forceTableFlush ( final String tableName , final String ... columnFamilies ) throws IOException , InterruptedException , ExecutionException { } public void forceTableRepair ( final String tableName , final String ... columnFamilies ) throws IOException { } InetAddress getPredecessor ( InetAddress ep ) { } public InetAddress getSuccessor ( InetAddress ep ) { } public Range getPrimaryRangeForEndpoint ( InetAddress ep ) { } Collection < Range > getRangesForEndpoint ( String table , InetAddress ep ) { } public List < Range > getAllRanges ( List < Token > sortedTokens ) { } public List < InetAddress > getNaturalEndpoints ( String table , ByteBuffer key ) { } public List < InetAddress > getNaturalEndpoints ( String table , byte [ ] key ) { } public List < InetAddress > getNaturalEndpoints ( String table , Token token ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , ByteBuffer key ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , Token token ) { } public void setLog4jLevel ( String classQualifier , String rawLevel ) { } public List < Token > getSplits ( String table , String cfName , Range range , int keysPerSplit ) { } public Token getBootstrapToken ( ) { } private void startLeaving ( ) { } public void decommission ( ) throws InterruptedException { } private void leaveRing ( ) { } private void unbootstrap ( final Runnable onFinish ) { } public void move ( String newToken ) throws IOException , InterruptedException { } public void loadBalance ( ) throws IOException , InterruptedException { } private void move ( final Token token ) throws IOException , InterruptedException { } public String getRemovalStatus ( ) { } public void forceRemoveCompletion ( ) { } public void removeToken ( String tokenString ) { } public void confirmReplication ( InetAddress node ) { } public boolean isClientMode ( ) { } public synchronized void requestGC ( ) { } private boolean hasUnreclaimedSpace ( ) { } public String getOperationMode ( ) { } public String getDrainProgress ( ) { } public synchronized void drain ( ) throws IOException , InterruptedException , ExecutionException { } public void loadSchemaFromYAML ( ) throws IOException , ConfigurationException { } public String exportSchema ( ) throws IOException { List < RawKeyspace > keyspaces = new ArrayList < RawKeyspace > ( ) ; for ( String ksname : DatabaseDescriptor . getNonSystemTables ( ) ) { KSMetaData ksm = DatabaseDescriptor . getTableDefinition ( ksname ) ; RawKeyspace rks = new RawKeyspace ( ) ; rks . name = ksm . name ; rks . replica_placement_strategy = ksm . strategyClass . getName ( ) ; rks . replication_factor = ksm . replicationFactor ; rks . column_families = new RawColumnFamily [ ksm . cfMetaData ( ) . size ( ) ] ; int i = 0 ; for ( CFMetaData cfm : ksm . cfMetaData ( ) . values ( ) ) { RawColumnFamily rcf = new RawColumnFamily ( ) ; rcf . name = cfm . cfName ; rcf . compare_with = cfm . comparator . getClass ( ) . getName ( ) ; rcf . default_validation_class = cfm . getDefaultValidator ( ) . getClass ( ) . getName ( ) ; rcf . compare_subcolumns_with = ( ( cfm . subcolumnComparator ) == null ) ? null : cfm . subcolumnComparator . getClass ( ) . getName ( ) ; rcf . column_type = cfm . cfType ; rcf . comment = cfm . getComment ( ) ; rcf . keys_cached = cfm . getKeyCacheSize ( ) ; rcf . read_repair_chance = cfm . getReadRepairChance ( ) ; rcf . gc_grace_seconds = cfm . getGcGraceSeconds ( ) ; rcf . rows_cached = cfm . getRowCacheSize ( ) ; rcf . column_metadata = new RawColumnDefinition [ cfm . getColumn_metadata ( ) . size ( ) ] ; int j = 0 ; for ( ColumnDefinition cd : cfm . getColumn_metadata ( ) . values ( ) ) { RawColumnDefinition rcd = new RawColumnDefinition ( ) ; rcd . index_name = cd . getIndexName ( ) ; rcd . index_type = cd . getIndexType ( ) ; <START_BUG> rcd . name = ByteBufferUtil . string ( cd . name , Charsets . UTF_8 ) ; <END_BUG> rcd . validator_class = cd . validator . getClass ( ) . getName ( ) ; rcf . column_metadata [ ( j ++ ) ] = rcd ; } if ( j == 0 ) rcf . column_metadata = null ; rks . column_families [ ( i ++ ) ] = rcf ; } keyspaces . add ( rks ) ; } DumperOptions options = new DumperOptions ( ) ; options . setDefaultFlowStyle ( BLOCK ) ; SkipNullRepresenter representer = new SkipNullRepresenter ( ) ; representer . addClassTag ( RawColumnFamily . class , MAP ) ; representer . addClassTag ( StorageService . Keyspaces . class , MAP ) ; representer . addClassTag ( ColumnDefinition . class , MAP ) ; Dumper dumper = new Dumper ( representer , options ) ; Yaml yaml = new Yaml ( dumper ) ; StorageService . Keyspaces ks = new StorageService . Keyspaces ( ) ; ks . keyspaces = keyspaces ; return yaml . dump ( ks ) ; } public class Keyspaces { public List < RawKeyspace > keyspaces ; } IPartitioner setPartitionerUnsafe ( IPartitioner newPartitioner ) { } TokenMetadata setTokenMetadataUnsafe ( TokenMetadata tmd ) { } public void truncate ( String keyspace , String columnFamily ) throws IOException , TimeoutException , UnavailableException { } public void saveCaches ( ) throws InterruptedException , ExecutionException { } public Map < Token , Float > getOwnership ( ) { } public List < String > getKeyspaces ( ) { } public void updateSnitch ( String epSnitchClassName , Boolean dynamic , Integer dynamicUpdateInterval , Integer dynamicResetInterval , Double dynamicBadnessThreshold ) throws ConfigurationException { }

Fix:
rcd . name = ByteBufferUtil . string ( cd . name ) ;