Buggy code:
public class bigAccRunnable implements Runnable { private Twitter bird ; private int index ; private int bigAccountIndex ; public bigAccRunnable ( Twitter twitter , int index , int bigAccountIndex ) { } public synchronized void findBigAccounts ( ) throws InterruptedException , UnknownHostException , FuckinUpKPException , TwitterException { } public void harvestBigAccounts ( ) throws InterruptedException , UnknownHostException , FuckinUpKPException { HashSet < Long > toFollowSet = new HashSet < Long > ( ) ; Long lastTweet = DataBaseHandler . getBigAccountLatestTweet ( index , bigAccountIndex ) ; <START_BUG> int bigAccountHarvestIndex = ( ( DataBaseHandler . getBigAccountsSize ( index ) ) == ( bigAccountIndex ) ) ? 0 : ( bigAccountIndex ) + 1 ; <END_BUG> int maxNoRTTweets = 30 ; Paging querySettings = new Paging ( ) ; querySettings . setCount ( 100 ) ; if ( lastTweet != ( - 1 ) ) { querySettings . setSinceId ( lastTweet ) ; } ResponseList < Status > tweets = null ; ArrayList < ResponseList < Status > > ListTweets = TwitterHandler . getUserTimeline ( bird , DataBaseHandler . getBigAccount ( index , bigAccountIndex ) , querySettings , index ) ; if ( ListTweets . isEmpty ( ) ) { Maintenance . writeLog ( "***ERROR***<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>run<seq2seq4repair_space>getUserTimelime<seq2seq4repair_space>in<seq2seq4repair_space>bigAccRunnable" , index ) ; return ; } else { tweets = ListTweets . get ( 0 ) ; } ArrayList < Status > NoRTTweets = new ArrayList < Status > ( ) ; for ( Status tweet : tweets ) { if ( ! ( tweet . isRetweet ( ) ) ) { NoRTTweets . add ( tweet ) ; } if ( ( NoRTTweets . size ( ) ) == maxNoRTTweets ) { break ; } } Collections . reverse ( NoRTTweets ) ; for ( Status tweet : NoRTTweets ) { ArrayList < Long > toFollows = TwitterHandler . getRetweeterIds ( bird , tweet . getId ( ) , 100 , ( - 1 ) , index ) ; if ( ( toFollows . size ( ) ) != 0 ) { for ( long id : toFollows ) { toFollowSet . add ( id ) ; } } DataBaseHandler . editBigAccountLatestTweet ( index , bigAccountIndex , tweet . getId ( ) ) ; } for ( Iterator < Long > i = toFollowSet . iterator ( ) ; i . hasNext ( ) ; ) { Long user_id = i . next ( ) ; if ( DataBaseHandler . isWhiteListed ( index , user_id ) ) { i . remove ( ) ; } } if ( ( toFollowSet . size ( ) ) == 0 ) { if ( ( ( DataBaseHandler . getBigAccountStrikes ( index , bigAccountIndex ) ) + 1 ) >= ( GlobalStuff . BIG_ACCOUNT_STRIKES_FOR_OUT ) ) { if ( ( ( DataBaseHandler . getBigAccountOuts ( index , bigAccountIndex ) ) + 1 ) >= ( GlobalStuff . BIG_ACCOUNT_OUTS_FOR_REMOVAL ) ) { DataBaseHandler . deleteBigAccount ( index , bigAccountIndex ) ; } else { DataBaseHandler . editBigAccountStrikes ( index , bigAccountIndex , 0 ) ; DataBaseHandler . editBigAccountOuts ( index , bigAccountIndex , ( ( DataBaseHandler . getBigAccountOuts ( index , bigAccountIndex ) ) + 1 ) ) ; DataBaseHandler . moveBigAccountToEnd ( index , bigAccountIndex ) ; } } else { DataBaseHandler . editBigAccountStrikes ( index , bigAccountIndex , ( ( DataBaseHandler . getBigAccountStrikes ( index , bigAccountIndex ) ) + 1 ) ) ; } } else { DataBaseHandler . addToFollow ( index , new ArrayList < Long > ( toFollowSet ) ) ; DataBaseHandler . addWhitelist ( index , new ArrayList < Long > ( toFollowSet ) ) ; } DataBaseHandler . editBigAccountHarvestIndex ( index , bigAccountHarvestIndex ) ; Maintenance . writeLog ( "done<seq2seq4repair_space>harvesting" , index ) ; } @ Override public void run ( ) { } }

Fix:
int bigAccountHarvestIndex = ( ( ( DataBaseHandler . getBigAccountsSize ( index ) ) - 1 ) == ( bigAccountIndex ) ) ? 0 : ( bigAccountIndex ) + 1 ;