Buggy code:
class ConsistencyChecker implements Runnable { private static Logger logger_ = LoggerFactory . getLogger ( ConsistencyChecker . class ) ; private static ScheduledExecutorService executor_ = new ScheduledThreadPoolExecutor ( 1 ) ; private final String table_ ; private final Row row_ ; protected final List < InetAddress > replicas_ ; private final ReadCommand readCommand_ ; public ConsistencyChecker ( String table , Row row , List < InetAddress > endpoints , ReadCommand readCommand ) { } public void run ( ) { } private ReadCommand constructReadMessage ( boolean isDigestQuery ) { } class DigestResponseHandler implements IAsyncCallback { private boolean repairInvoked ; public synchronized void response ( Message response ) { if ( repairInvoked ) return ; try { byte [ ] body = response . getMessageBody ( ) ; ByteArrayInputStream bufIn = new ByteArrayInputStream ( body ) ; ReadResponse result = ReadResponse . serializer ( ) . deserialize ( new DataInputStream ( bufIn ) ) ; byte [ ] digest = result . digest ( ) ; if ( ! ( Arrays . equals ( ColumnFamily . digest ( row_ . cf ) , digest ) ) ) { <START_BUG> IResponseResolver < Row > readResponseResolver = new ReadResponseResolver ( table_ , replicas_ . size ( ) ) ; <END_BUG> IAsyncCallback responseHandler ; if ( replicas_ . contains ( FBUtilities . getLocalAddress ( ) ) ) responseHandler = new ConsistencyChecker . DataRepairHandler ( row_ , replicas_ . size ( ) , readResponseResolver ) ; else responseHandler = new ConsistencyChecker . DataRepairHandler ( replicas_ . size ( ) , readResponseResolver ) ; ReadCommand readCommand = constructReadMessage ( false ) ; Message message = readCommand . makeReadMessage ( ) ; if ( ConsistencyChecker . logger_ . isDebugEnabled ( ) ) ConsistencyChecker . logger_ . debug ( ( ( ( ( ( ( "Performing<seq2seq4repair_space>read<seq2seq4repair_space>repair<seq2seq4repair_space>for<seq2seq4repair_space>" + ( readCommand_ . key ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( message . getMessageId ( ) ) ) + "@[" ) + ( StringUtils . join ( replicas_ , ",<seq2seq4repair_space>" ) ) ) + "]" ) ) ; instance . addCallback ( responseHandler , message . getMessageId ( ) ) ; for ( InetAddress endpoint : replicas_ ) { if ( ! ( endpoint . equals ( FBUtilities . getLocalAddress ( ) ) ) ) instance . sendOneWay ( message , endpoint ) ; } repairInvoked = true ; } } catch ( Exception e ) { throw new RuntimeException ( ( "Error<seq2seq4repair_space>handling<seq2seq4repair_space>responses<seq2seq4repair_space>for<seq2seq4repair_space>" + ( row_ ) ) , e ) ; } } } static class DataRepairHandler implements IAsyncCallback { private final Collection < Message > responses_ = new LinkedBlockingQueue < Message > ( ) ; private final IResponseResolver < Row > readResponseResolver_ ; private final int majority_ ; DataRepairHandler ( int responseCount , IResponseResolver < Row > readResponseResolver ) { } public DataRepairHandler ( Row localRow , int responseCount , IResponseResolver < Row > readResponseResolver ) throws IOException { } public synchronized void response ( Message message ) { if ( ConsistencyChecker . logger_ . isDebugEnabled ( ) ) ConsistencyChecker . logger_ . debug ( ( "Received<seq2seq4repair_space>responses<seq2seq4repair_space>in<seq2seq4repair_space>DataRepairHandler<seq2seq4repair_space>:<seq2seq4repair_space>" + ( message . toString ( ) ) ) ) ; responses_ . add ( message ) ; if ( ( responses_ . size ( ) ) == ( majority_ ) ) { Runnable runnable = new WrappedRunnable ( ) { public void runMayThrow ( ) throws IOException , DigestMismatchException { readResponseResolver_ . resolve ( responses_ ) ; } } ; ConsistencyChecker . executor_ . schedule ( runnable , DatabaseDescriptor . getRpcTimeout ( ) , TimeUnit . MILLISECONDS ) ; } } } }

Fix:
IResponseResolver < Row > readResponseResolver = new ReadResponseResolver ( table_ ) ;