Buggy code:
public class StorageProxy implements StorageProxyMBean { private static final Logger logger = LoggerFactory . getLogger ( StorageProxy . class ) ; private static final Random random = new Random ( ) ; private static final LatencyTracker readStats = new LatencyTracker ( ) ; private static final LatencyTracker rangeStats = new LatencyTracker ( ) ; private static final LatencyTracker writeStats = new LatencyTracker ( ) ; private static boolean hintedHandoffEnabled = DatabaseDescriptor . hintedHandoffEnabled ( ) ; private static final String UNREACHABLE = "UNREACHABLE" ; private StorageProxy ( ) { } public static void mutate ( List < RowMutation > mutations , ConsistencyLevel consistency_level ) throws TimeoutException , UnavailableException { } private static void addHintHeader ( Message message , InetAddress target ) throws IOException { } private static void insertLocalMessage ( final RowMutation rm , final IWriteResponseHandler responseHandler ) { } public static List < Row > readProtocol ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , InvalidRequestException , UnavailableException { } private static List < Row > weakRead ( List < ReadCommand > commands ) throws IOException , TimeoutException , UnavailableException { } private static List < Row > strongRead ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , UnavailableException { List < QuorumResponseHandler < Row > > quorumResponseHandlers = new ArrayList < QuorumResponseHandler < Row > > ( ) ; List < List < InetAddress > > commandEndpoints = new ArrayList < List < InetAddress > > ( ) ; List < Row > rows = new ArrayList < Row > ( ) ; for ( ReadCommand command : commands ) { assert ! ( command . isDigestQuery ( ) ) ; ReadCommand readMessageDigestOnly = command . copy ( ) ; readMessageDigestOnly . setDigestQuery ( true ) ; Message message = command . makeReadMessage ( ) ; Message messageDigestOnly = readMessageDigestOnly . makeReadMessage ( ) ; InetAddress dataPoint = instance . findSuitableEndpoint ( command . table , command . key ) ; List < InetAddress > endpoints = instance . getLiveNaturalEndpoints ( command . table , command . key ) ; AbstractReplicationStrategy rs = Table . open ( command . table ) . getReplicationStrategy ( ) ; QuorumResponseHandler < Row > handler = rs . getQuorumResponseHandler ( new ReadResponseResolver ( command . table ) , consistency_level ) ; handler . assureSufficientLiveNodes ( endpoints ) ; Message [ ] messages = new Message [ endpoints . size ( ) ] ; int n = 0 ; for ( InetAddress endpoint : endpoints ) { Message m = ( endpoint . equals ( dataPoint ) ) ? message : messageDigestOnly ; messages [ ( n ++ ) ] = m ; if ( StorageProxy . logger . isDebugEnabled ( ) ) StorageProxy . logger . debug ( ( ( ( ( ( ( ( "strongread<seq2seq4repair_space>reading<seq2seq4repair_space>" + ( m == message ? "data" : "digest" ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>" ) + command ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ) + ( m . getMessageId ( ) ) ) + "@" ) + endpoint ) ) ; } MessagingService . instance . sendRR ( messages , endpoints , handler ) ; quorumResponseHandlers . add ( handler ) ; commandEndpoints . add ( endpoints ) ; } List < QuorumResponseHandler < Row > > repairResponseHandlers = null ; for ( int i = 0 ; i < ( commands . size ( ) ) ; i ++ ) { QuorumResponseHandler < Row > quorumResponseHandler = quorumResponseHandlers . get ( i ) ; Row row ; ReadCommand command = commands . get ( i ) ; try { long startTime2 = System . currentTimeMillis ( ) ; row = quorumResponseHandler . get ( ) ; if ( row != null ) rows . add ( row ) ; if ( StorageProxy . logger . isDebugEnabled ( ) ) StorageProxy . logger . debug ( ( ( "quorumResponseHandler:<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - startTime2 ) ) + "<seq2seq4repair_space>ms." ) ) ; } catch ( DigestMismatchException ex ) { AbstractReplicationStrategy rs = Table . open ( command . table ) . getReplicationStrategy ( ) ; <START_BUG> QuorumResponseHandler < Row > handler = rs . getQuorumResponseHandler ( new ReadResponseResolver ( command . table ) , QUORUM ) ; <END_BUG> if ( StorageProxy . logger . isDebugEnabled ( ) ) StorageProxy . logger . debug ( "Digest<seq2seq4repair_space>mismatch:" , ex ) ; Message messageRepair = command . makeReadMessage ( ) ; MessagingService . instance . sendRR ( messageRepair , commandEndpoints . get ( i ) , handler ) ; if ( repairResponseHandlers == null ) repairResponseHandlers = new ArrayList < QuorumResponseHandler < Row > > ( ) ; repairResponseHandlers . add ( handler ) ; } } if ( repairResponseHandlers != null ) { for ( QuorumResponseHandler < Row > handler : repairResponseHandlers ) { try { Row row = handler . get ( ) ; if ( row != null ) rows . add ( row ) ; } catch ( DigestMismatchException e ) { throw new AssertionError ( e ) ; } } } return rows ; } public static List < Row > getRangeSlice ( RangeSliceCommand command , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , UnavailableException { } public static Map < String , List < String > > describeSchemaVersions ( ) { } static List < AbstractBounds > getRestrictedRanges ( final AbstractBounds queryRange ) { } private static boolean randomlyReadRepair ( ReadCommand command ) { } public long getReadOperations ( ) { } public long getTotalReadLatencyMicros ( ) { } public double getRecentReadLatencyMicros ( ) { } public long getRangeOperations ( ) { } public long getTotalRangeLatencyMicros ( ) { } public double getRecentRangeLatencyMicros ( ) { } public long getWriteOperations ( ) { } public long getTotalWriteLatencyMicros ( ) { } public double getRecentWriteLatencyMicros ( ) { }

Fix:
QuorumResponseHandler < Row > handler = rs . getQuorumResponseHandler ( new ReadResponseResolver ( command . table ) , consistency_level ) ;