Buggy code:
public class StorageProxy implements StorageProxyMBean { private static final Logger logger = LoggerFactory . getLogger ( StorageProxy . class ) ; 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 int maxHintWindow = DatabaseDescriptor . getMaxHintWindow ( ) ; public static final String UNREACHABLE = "UNREACHABLE" ; private static final StorageProxy . WritePerformer standardWritePerformer ; private static final StorageProxy . WritePerformer counterWritePerformer ; private static final StorageProxy . WritePerformer counterWriteOnCoordinatorPerformer ; public static final StorageProxy instance = new StorageProxy ( ) ; private StorageProxy ( ) { } public static void mutate ( List < ? extends IMutation > mutations , ConsistencyLevel consistency_level ) throws TimeoutException , UnavailableException { } public static IWriteResponseHandler performWrite ( IMutation mutation , ConsistencyLevel consistency_level , String localDataCenter , StorageProxy . WritePerformer performer ) throws IOException , TimeoutException , UnavailableException { } private static Collection < InetAddress > getWriteEndpoints ( String table , ByteBuffer key ) { } public static void sendToHintedEndpoints ( final RowMutation rm , Multimap < InetAddress , InetAddress > hintedEndpoints , IWriteResponseHandler responseHandler , String localDataCenter , ConsistencyLevel consistency_level ) throws IOException { } private static void sendMessages ( String localDataCenter , Map < String , Multimap < Message , InetAddress > > dcMessages , IWriteResponseHandler handler ) throws IOException { for ( Map . Entry < String , Multimap < Message , InetAddress > > entry : dcMessages . entrySet ( ) ) { String dataCenter = entry . getKey ( ) ; for ( Map . Entry < Message , Collection < InetAddress > > messages : entry . getValue ( ) . asMap ( ) . entrySet ( ) ) { Message message = messages . getKey ( ) ; message . removeHeader ( FORWARD_HEADER ) ; <START_BUG> if ( ( dataCenter . equals ( localDataCenter ) ) || ( StorageService . instance . useEfficientCrossDCWrites ( ) ) ) { <END_BUG> for ( InetAddress destination : messages . getValue ( ) ) MessagingService . instance ( ) . sendRR ( message , destination , handler ) ; } else { Iterator < InetAddress > iter = messages . getValue ( ) . iterator ( ) ; InetAddress target = iter . next ( ) ; while ( iter . hasNext ( ) ) { InetAddress destination = iter . next ( ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; byte [ ] previousHints = message . getHeader ( FORWARD_HEADER ) ; if ( previousHints != null ) dos . write ( previousHints ) ; dos . write ( destination . getAddress ( ) ) ; message . setHeader ( FORWARD_HEADER , bos . toByteArray ( ) ) ; } MessagingService . instance ( ) . sendRR ( message , target , handler ) ; } } } } private static void addHintHeader ( Message message , InetAddress target ) throws IOException { } private static void insertLocal ( final RowMutation rm , final IWriteResponseHandler responseHandler ) { } public static IWriteResponseHandler mutateCounter ( CounterMutation cm , String localDataCenter ) throws IOException , TimeoutException , UnavailableException { } private static InetAddress findSuitableEndpoint ( String table , ByteBuffer key , String localDataCenter ) throws UnavailableException { } public static IWriteResponseHandler applyCounterMutationOnLeader ( CounterMutation cm , String localDataCenter ) throws IOException , TimeoutException , UnavailableException { } public static IWriteResponseHandler applyCounterMutationOnCoordinator ( CounterMutation cm , String localDataCenter ) throws IOException , TimeoutException , UnavailableException { } private static Runnable counterWriteTask ( final IMutation mutation , final Multimap < InetAddress , InetAddress > hintedEndpoints , final IWriteResponseHandler responseHandler , final String localDataCenter , final ConsistencyLevel consistency_level ) { } public static List < Row > read ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , InvalidRequestException , UnavailableException { } private static List < Row > fetchRows ( List < ReadCommand > commands , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , UnavailableException { } static class LocalReadRunnable extends StorageProxy . DroppableRunnable { private final ReadCommand command ; private final ReadCallback < Row > handler ; private final long start = System . currentTimeMillis ( ) ; LocalReadRunnable ( ReadCommand command , ReadCallback < Row > handler ) { } protected void runMayThrow ( ) throws IOException { } } static < T > ReadCallback < T > getReadCallback ( IResponseResolver < T > resolver , IReadCommand command , ConsistencyLevel consistencyLevel , List < InetAddress > endpoints ) { } 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 ) { } public long getReadOperations ( ) { } public long getTotalReadLatencyMicros ( ) { } public double getRecentReadLatencyMicros ( ) { } public long [ ] getTotalReadLatencyHistogramMicros ( ) { } public long [ ] getRecentReadLatencyHistogramMicros ( ) { } public long getRangeOperations ( ) { } public long getTotalRangeLatencyMicros ( ) { } public double getRecentRangeLatencyMicros ( ) { } public long [ ] getTotalRangeLatencyHistogramMicros ( ) { } public long [ ] getRecentRangeLatencyHistogramMicros ( ) { } public long getWriteOperations ( ) { } public long getTotalWriteLatencyMicros ( ) { } public double getRecentWriteLatencyMicros ( ) { } public long [ ] getTotalWriteLatencyHistogramMicros ( ) { } public long [ ] getRecentWriteLatencyHistogramMicros ( ) { } public static List < Row > scan ( final String keyspace , String column_family , IndexClause index_clause , SlicePredicate column_predicate , ConsistencyLevel consistency_level ) throws IOException , TimeoutException , UnavailableException { } public boolean getHintedHandoffEnabled ( ) { } public void setHintedHandoffEnabled ( boolean b ) { }

Fix:
if ( dataCenter . equals ( localDataCenter ) ) {