Buggy code:
public CFMetaData keyValidator ( AbstractType prop ) { } public CFMetaData minCompactionThreshold ( int prop ) { } public CFMetaData maxCompactionThreshold ( int prop ) { } public CFMetaData rowCacheSavePeriod ( int prop ) { } public CFMetaData keyCacheSavePeriod ( int prop ) { } public CFMetaData memTime ( int prop ) { } public CFMetaData memSize ( int prop ) { } public CFMetaData memOps ( double prop ) { } public CFMetaData mergeShardsChance ( double prop ) { } public CFMetaData columnMetadata ( Map < ByteBuffer , ColumnDefinition > prop ) { } public CFMetaData rowCacheProvider ( IRowCacheProvider prop ) { } public CFMetaData ( String keyspace , String name , ColumnFamilyType type , AbstractType comp , AbstractType subcc ) { } private CFMetaData ( String keyspace , String name , ColumnFamilyType type , AbstractType comp , AbstractType subcc , int id ) { } private AbstractType enforceSubccDefault ( ColumnFamilyType cftype , AbstractType subcc ) { } private static String enforceCommentNotNull ( CharSequence comment ) { } private void init ( ) { } private static CFMetaData newSystemMetadata ( String cfName , int cfId , String comment , AbstractType comparator , AbstractType subcc , int memtableThroughPutInMB ) { } public static CFMetaData newIndexMetadata ( CFMetaData parent , ColumnDefinition info , AbstractType columnComparator ) { } public static CFMetaData rename ( CFMetaData cfm , String newName ) { } public static CFMetaData renameTable ( CFMetaData cfm , String ksName ) { } private static CFMetaData copyOpts ( CFMetaData newCFMD , CFMetaData oldCFMD ) { } public static void purge ( CFMetaData cfm ) { } public static String indexName ( String parentCf , ColumnDefinition info ) { } public CfDef deflate ( ) { } public static CFMetaData inflate ( CfDef cf ) { } public String getComment ( ) { } public double getRowCacheSize ( ) { } public double getKeyCacheSize ( ) { } public double getReadRepairChance ( ) { } public double getMergeShardsChance ( ) { } public boolean getReplicateOnWrite ( ) { } public int getGcGraceSeconds ( ) { } public AbstractType getDefaultValidator ( ) { } public AbstractType getKeyValidator ( ) { } public Integer getMinCompactionThreshold ( ) { } public Integer getMaxCompactionThreshold ( ) { } public int getRowCacheSavePeriodInSeconds ( ) { } public int getKeyCacheSavePeriodInSeconds ( ) { } public int getMemtableFlushAfterMins ( ) { } public int getMemtableThroughputInMb ( ) { } public double getMemtableOperationsInMillions ( ) { } public IRowCacheProvider getRowCacheProvider ( ) { } public Map < ByteBuffer , ColumnDefinition > getColumn_metadata ( ) { } public AbstractType getComparatorFor ( ByteBuffer superColumnName ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } private static int nextId ( ) { } public AbstractType getValueValidator ( ByteBuffer column ) { } public static void applyImplicitDefaults ( org . apache . cassandra . thrift . CfDef cf_def ) { } public void apply ( CfDef cf_def ) throws ConfigurationException { } public static org . apache . cassandra . thrift . CfDef convertToThrift ( CFMetaData cfm ) { } public static CfDef convertToAvro ( CFMetaData cfm ) { } public static CfDef convertToAvro ( org . apache . cassandra . thrift . CfDef def ) { CfDef newDef = new CfDef ( ) ; newDef . keyspace = def . getKeyspace ( ) ; newDef . name = def . getName ( ) ; newDef . column_type = def . getColumn_type ( ) ; newDef . comment = def . getComment ( ) ; newDef . comparator_type = def . getComparator_type ( ) ; newDef . default_validation_class = def . getDefault_validation_class ( ) ; newDef . key_validation_class = def . getKey_validation_class ( ) ; newDef . gc_grace_seconds = def . getGc_grace_seconds ( ) ; newDef . id = def . getId ( ) ; newDef . key_cache_save_period_in_seconds = def . getKey_cache_save_period_in_seconds ( ) ; newDef . key_cache_size = def . getKey_cache_size ( ) ; newDef . max_compaction_threshold = def . getMax_compaction_threshold ( ) ; newDef . memtable_flush_after_mins = def . getMemtable_flush_after_mins ( ) ; newDef . memtable_operations_in_millions = def . getMemtable_operations_in_millions ( ) ; newDef . memtable_throughput_in_mb = def . getMemtable_throughput_in_mb ( ) ; newDef . min_compaction_threshold = def . getMin_compaction_threshold ( ) ; newDef . read_repair_chance = def . getRead_repair_chance ( ) ; newDef . replicate_on_write = def . isReplicate_on_write ( ) ; newDef . row_cache_save_period_in_seconds = def . getRow_cache_save_period_in_seconds ( ) ; newDef . row_cache_size = def . getRow_cache_size ( ) ; newDef . subcomparator_type = def . getSubcomparator_type ( ) ; newDef . merge_shards_chance = def . getMerge_shards_chance ( ) ; List < ColumnDef > columnMeta = new ArrayList < ColumnDef > ( ) ; if ( def . isSetColumn_metadata ( ) ) { for ( org . apache . cassandra . thrift . ColumnDef cdef : def . getColumn_metadata ( ) ) { ColumnDef tdef = new ColumnDef ( ) ; <START_BUG> tdef . name = ByteBufferUtil . clone ( cdef . BufferForName ( ) ) ; <END_BUG> tdef . validation_class = cdef . getValidation_class ( ) ; tdef . index_name = cdef . getIndex_name ( ) ; tdef . index_type = ( ( cdef . getIndex_type ( ) ) == null ) ? null : org . apache . cassandra . db . migration . avro . IndexType . valueOf ( cdef . getIndex_type ( ) . name ( ) ) ; columnMeta . add ( tdef ) ; } } newDef . column_metadata = columnMeta ; return newDef ; } public static void validateMinMaxCompactionThresholds ( org . apache . cassandra . thrift . CfDef cf_def ) throws ConfigurationException { } public static void validateMinMaxCompactionThresholds ( CfDef cf_def ) throws ConfigurationException { } public static void validateMemtableSettings ( org . apache . cassandra . thrift . CfDef cf_def ) throws ConfigurationException { } public static void validateMemtableSettings ( CfDef cf_def ) throws ConfigurationException { } @ Override public String toString ( ) { } }

Fix:
tdef . name = ByteBufferUtil . clone ( cdef . bufferForName ( ) ) ;