Buggy code:
private List < String > stringify ( Iterable < InetAddress > endpoints ) { } public int getCurrentGenerationNumber ( ) { } public void forceTableCleanup ( String tableName , String ... columnFamilies ) throws IOException , InterruptedException , ExecutionException { } public void scrub ( String tableName , String ... columnFamilies ) throws IOException , InterruptedException , ExecutionException { } public void forceTableCompaction ( String tableName , String ... columnFamilies ) throws IOException , InterruptedException , ExecutionException { } public void invalidateKeyCaches ( String tableName , String ... columnFamilies ) throws IOException { } public void invalidateRowCaches ( String tableName , String ... columnFamilies ) throws IOException { } public void takeSnapshot ( String tag , String ... tableNames ) throws IOException { } private Table getValidTable ( String tableName ) throws IOException { } public void clearSnapshot ( String tag , String ... tableNames ) throws IOException { } public Iterable < ColumnFamilyStore > getValidColumnFamilies ( String tableName , String ... cfNames ) throws IOException { } public void forceTableFlush ( final String tableName , final String ... columnFamilies ) throws IOException , InterruptedException , ExecutionException { } public void forceTableRepair ( final String tableName , final String ... columnFamilies ) throws IOException { } public RepairSession forceTableRepair ( final Range range , final String tableName , final String ... columnFamilies ) throws IOException { } InetAddress getPredecessor ( InetAddress ep ) { } public InetAddress getSuccessor ( InetAddress ep ) { } public Range getPrimaryRangeForEndpoint ( InetAddress ep ) { } Collection < Range > getRangesForEndpoint ( String table , InetAddress ep ) { } public List < Range > getAllRanges ( List < Token > sortedTokens ) { } public List < InetAddress > getNaturalEndpoints ( String table , byte [ ] key ) { } public List < InetAddress > getNaturalEndpoints ( String table , ByteBuffer key ) { } public List < InetAddress > getNaturalEndpoints ( String table , Token token ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , ByteBuffer key ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , Token token ) { } public void setLog4jLevel ( String classQualifier , String rawLevel ) { } public List < Token > getSplits ( String table , String cfName , Range range , int keysPerSplit ) { } public Token getBootstrapToken ( ) { } private void startLeaving ( ) { } public void decommission ( ) throws InterruptedException { } private void leaveRing ( ) { } private void unbootstrap ( final Runnable onFinish ) { } public void move ( String newToken ) throws IOException , InterruptedException { } private void move ( Token newToken ) throws IOException { } public String getRemovalStatus ( ) { } public void forceRemoveCompletion ( ) { } public void removeToken ( String tokenString ) { } public void confirmReplication ( InetAddress node ) { } public boolean isClientMode ( ) { } public synchronized void requestGC ( ) { } private boolean hasUnreclaimedSpace ( ) { } public String getOperationMode ( ) { } public String getDrainProgress ( ) { } public synchronized void drain ( ) throws IOException , InterruptedException , ExecutionException { } IPartitioner setPartitionerUnsafe ( IPartitioner newPartitioner ) { } TokenMetadata setTokenMetadataUnsafe ( TokenMetadata tmd ) { } public void truncate ( String keyspace , String columnFamily ) throws IOException , TimeoutException , UnavailableException { } public void saveCaches ( ) throws InterruptedException , ExecutionException { } public Map < Token , Float > getOwnership ( ) { } public List < String > getKeyspaces ( ) { } public void updateSnitch ( String epSnitchClassName , Boolean dynamic , Integer dynamicUpdateInterval , Integer dynamicResetInterval , Double dynamicBadnessThreshold ) throws ConfigurationException { } public boolean useEfficientCrossDCWrites ( ) { } public void flushLargestMemtables ( ) { } public void reduceCacheSizes ( ) { } private CountDownLatch streamRanges ( final Map < String , Multimap < Range , InetAddress > > rangesToStreamByTable ) { final CountDownLatch latch = new CountDownLatch ( rangesToStreamByTable . keySet ( ) . size ( ) ) ; for ( final String table : rangesToStreamByTable . keySet ( ) ) { Multimap < Range , InetAddress > rangesWithEndpoints = rangesToStreamByTable . get ( table ) ; if ( rangesWithEndpoints . isEmpty ( ) ) { latch . countDown ( ) ; continue ; } final Set < Map . Entry < Range , InetAddress > > pending = new HashSet < Map . Entry < Range , InetAddress > > ( rangesWithEndpoints . entries ( ) ) ; for ( final Map . Entry < Range , InetAddress > entry : rangesWithEndpoints . entries ( ) ) { final Range range = entry . getKey ( ) ; final InetAddress newEndpoint = entry . getValue ( ) ; final Runnable callback = new Runnable ( ) { public void run ( ) { synchronized ( pending ) { pending . remove ( entry ) ; if ( pending . isEmpty ( ) ) latch . countDown ( ) ; } } } ; StageManager . getStage ( STREAM ) . execute ( new Runnable ( ) { public void run ( ) { <START_BUG> StreamOut . transferRanges ( newEndpoint , Table . open ( table ) , Arrays . asList ( range ) , callback , UNBOOTSTRAP ) ; <END_BUG> } } ) ; } } return latch ; } private CountDownLatch requestRanges ( final Map < String , Multimap < InetAddress , Range > > ranges ) { } private Pair < Set < Range > , Set < Range > > calculateStreamAndFetchRanges ( Collection < Range > current , Collection < Range > updated ) { } private Pair < Set < Range > , Set < Range > > calculateStreamAndFetchRanges ( Iterator < Range > current , Iterator < Range > updated ) { } public void bulkLoad ( String directory ) { } }

Fix:
StreamOut . transferRanges ( newEndpoint , table , Arrays . asList ( range ) , callback , UNBOOTSTRAP ) ;