Buggy code:
public class ThriftConversion { public static ConsistencyLevel fromThrift ( ConsistencyLevel cl ) { } public static ConsistencyLevel toThrift ( ConsistencyLevel cl ) { } public static RuntimeException rethrow ( RequestExecutionException e ) throws TimedOutException , UnavailableException { } public static InvalidRequestException toThrift ( RequestValidationException e ) { } public static UnavailableException toThrift ( org . apache . cassandra . exceptions . UnavailableException e ) { } public static AuthenticationException toThrift ( org . apache . cassandra . exceptions . AuthenticationException e ) { } public static TimedOutException toThrift ( RequestTimeoutException e ) { } public static TimedOutException toThrift ( RequestFailureException e ) { } public static RowFilter rowFilterFromThrift ( CFMetaData metadata , List < IndexExpression > exprs ) { } public static KeyspaceMetadata fromThrift ( KsDef ksd , CFMetaData ... cfDefs ) throws ConfigurationException { } public static KsDef toThrift ( KeyspaceMetadata ksm ) { } public static CFMetaData fromThrift ( CfDef cf_def ) throws org . apache . cassandra . exceptions . InvalidRequestException , ConfigurationException { } public static CFMetaData fromThriftForUpdate ( CfDef cf_def , CFMetaData toUpdate ) throws org . apache . cassandra . exceptions . InvalidRequestException , ConfigurationException { } private static boolean isSuper ( String thriftColumnType ) throws org . apache . cassandra . exceptions . InvalidRequestException { } private static CFMetaData internalFromThrift ( CfDef cf_def , boolean isCreation , Collection < ColumnDefinition > previousCQLMetadata , boolean isDense ) throws org . apache . cassandra . exceptions . InvalidRequestException , ConfigurationException { } @ SuppressWarnings ( "unchecked" ) private static CompactionParams compactionParamsFromThrift ( CfDef cf_def ) { } private static CompressionParams compressionParametersFromThrift ( Map < String , String > compression_options ) { } private static void addDefaultCQLMetadata ( Collection < ColumnDefinition > defs , String ks , String cf , AbstractType < ? > keyValidator , AbstractType < ? > comparator , AbstractType < ? > subComparator , AbstractType < ? > defaultValidator ) { } @ SuppressWarnings ( "deprecation" ) private static void applyImplicitDefaults ( org . apache . cassandra . thrift . CfDef cf_def ) { } public static CfDef toThrift ( CFMetaData cfm ) { } public static ColumnDefinition fromThrift ( String ksName , String cfName , AbstractType < ? > thriftComparator , AbstractType < ? > thriftSubcomparator , ColumnDef thriftColumnDef ) throws ConfigurationException , SyntaxException { } private static List < ColumnDefinition > fromThrift ( String ksName , String cfName , AbstractType < ? > thriftComparator , AbstractType < ? > thriftSubcomparator , List < ColumnDef > thriftDefs ) throws ConfigurationException , SyntaxException { } private static Indexes indexDefsFromThrift ( CFMetaData cfm , String ksName , String cfName , AbstractType < ? > thriftComparator , AbstractType < ? > thriftSubComparator , List < ColumnDef > thriftDefs ) { } @ VisibleForTesting public static ColumnDef toThrift ( CFMetaData cfMetaData , ColumnDefinition column ) { ColumnDef cd = new ColumnDef ( ) ; cd . setName ( ByteBufferUtil . clone ( column . name . bytes ) ) ; cd . setValidation_class ( column . type . toString ( ) ) ; IndexMetadata matchedIndex = null ; for ( IndexMetadata index : cfMetaData . getIndexes ( ) ) { Pair < ColumnDefinition , IndexTarget . Type > target = CassandraIndex . parseTarget ( cfMetaData , index ) ; if ( target . left . equals ( column ) ) { if ( matchedIndex != null ) return cd ; matchedIndex = index ; } } if ( matchedIndex != null ) { cd . setIndex_type ( org . apache . cassandra . thrift . IndexType . valueOf ( matchedIndex . kind . name ( ) ) ) ; cd . setIndex_name ( matchedIndex . name ) ; Map < String , String > filteredOptions = Maps . filterKeys ( matchedIndex . options , ( s ) -> ! ( IndexTarget . TARGET_OPTION_NAME . equals ( s ) ) ) ; <START_BUG> cd . setIndex_options ( ( filteredOptions . isEmpty ( ) ? null : Maps . newHashMap ( matchedIndex . options ) ) ) ; <END_BUG> } return cd ; } private static List < ColumnDef > columnDefinitionsToThrift ( CFMetaData metadata , Collection < ColumnDefinition > columns ) { } private static Triggers triggerDefinitionsFromThrift ( List < TriggerDef > thriftDefs ) { } private static List < TriggerDef > triggerDefinitionsToThrift ( Triggers triggers ) { } @ SuppressWarnings ( "deprecation" ) public static Map < String , String > compressionParametersToThrift ( CompressionParams parameters ) { } private static String toThrift ( CachingParams caching ) { } private static CachingParams cachingFromTrhfit ( String caching ) { } private static String toThriftCellsPerRow ( CachingParams caching ) { } private static int fromThriftCellsPerRow ( String value ) { } public static CachingParams cachingFromThrift ( String caching , String cellsPerRow ) { } }

Fix:
cd . setIndex_options ( ( filteredOptions . isEmpty ( ) ? null : Maps . newHashMap ( filteredOptions ) ) ) ;