Buggy code:
private void handleStateBootstrap ( InetAddress endpoint , String [ ] pieces ) { } private void handleStateNormal ( InetAddress endpoint , String [ ] pieces ) { } private void handleStateLeaving ( InetAddress endpoint , String [ ] pieces ) { } private void handleStateLeft ( InetAddress endpoint , String [ ] pieces ) { } private void removeEndpointLocally ( InetAddress endpoint ) { } private void calculatePendingRanges ( ) { } public static void calculatePendingRanges ( AbstractReplicationStrategy strategy , String table ) { } private void restoreReplicaCount ( InetAddress endpoint ) { } private Multimap < Range , InetAddress > getChangedRangesForLeaving ( String table , InetAddress endpoint ) { } public void onJoin ( InetAddress endpoint , EndpointState epState ) { } public void onAlive ( InetAddress endpoint , EndpointState state ) { } public void onRemove ( InetAddress endpoint ) { } public void onDead ( InetAddress endpoint , EndpointState state ) { } public double getLoad ( ) { } public String getLoadString ( ) { } public Map < String , String > getLoadMap ( ) { } public final void deliverHints ( InetAddress endpoint ) { } public final void deliverHints ( String host ) throws UnknownHostException { } public Token getLocalToken ( ) { } public String getToken ( ) { } public String getReleaseVersion ( ) { } public Set < String > getLeavingNodes ( ) { } public Set < String > getJoiningNodes ( ) { } public Set < String > getLiveNodes ( ) { } public Set < String > getUnreachableNodes ( ) { } private Set < String > stringify ( Collection < InetAddress > endpoints ) { } private List < String > stringify ( List < InetAddress > endpoints ) { } public int getCurrentGenerationNumber ( ) { } public void forceTableCleanup ( ) throws IOException { } public void forceTableCleanup ( String tableName ) throws IOException { } public void forceTableCompaction ( ) throws IOException { } public void forceTableCompaction ( String tableName ) throws IOException { } public void takeSnapshot ( String tableName , String tag ) throws IOException { } private Table getValidTable ( String tableName ) throws IOException { } public void takeAllSnapshot ( String tag ) throws IOException { } public void clearSnapshot ( ) throws IOException { } public Iterable < ColumnFamilyStore > getValidColumnFamilies ( String tableName , String ... cfNames ) throws IOException { } public void forceTableFlush ( final String tableName , final String ... columnFamilies ) throws IOException { } public void forceTableRepair ( 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 , Token token ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , byte [ ] key ) { } public List < InetAddress > getLiveNaturalEndpoints ( String table , Token token ) { } public InetAddress findSuitableEndpoint ( String table , byte [ ] key ) throws IOException , UnavailableException { } public void setLog4jLevel ( String classQualifier , String rawLevel ) { } public List < Token > getSplits ( String table , String cfName , Range range , int keysPerSplit ) { List < Token > tokens = new ArrayList < Token > ( ) ; tokens . add ( range . left ) ; List < DecoratedKey > keys = new ArrayList < DecoratedKey > ( ) ; Table t = Table . open ( table ) ; ColumnFamilyStore cfs = t . getColumnFamilyStore ( cfName ) ; for ( DecoratedKey sample : cfs . allKeySamples ( ) ) { if ( range . contains ( sample . token ) ) keys . add ( sample ) ; } FBUtilities . sortSampledKeys ( keys , range ) ; <START_BUG> int splits = ( ( keys . size ( ) ) * ( SSTableReader . indexInterval ( ) ) ) // keysPerSplit ; <END_BUG> if ( ( keys . size ( ) ) >= splits ) { for ( int i = 1 ; i < splits ; i ++ ) { int index = i * ( ( keys . size ( ) ) // splits ) ; tokens . add ( keys . get ( index ) . token ) ; } } tokens . add ( range . right ) ; return tokens ; } 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 { } public void loadBalance ( ) throws IOException , InterruptedException { } private void move ( final Token token ) throws IOException , InterruptedException { } public void removeToken ( String tokenString ) { } public boolean isClientMode ( ) { } public synchronized void requestGC ( ) { } private boolean hasUnreclaimedSpace ( ) { } public String getOperationMode ( ) { } public synchronized void drain ( ) throws IOException , InterruptedException , ExecutionException { } public void loadSchemaFromYAML ( ) throws IOException , ConfigurationException { } public String exportSchema ( ) throws IOException { } public class Keyspaces { public List < RawKeyspace > keyspaces ; } Map < String , AbstractReplicationStrategy > setReplicationStrategyUnsafe ( Map < String , AbstractReplicationStrategy > replacement ) { } IPartitioner setPartitionerUnsafe ( IPartitioner newPartitioner ) { }

Fix:
int splits = ( ( keys . size ( ) ) * ( DatabaseDescriptor . getIndexInterval ( ) ) ) // keysPerSplit ;