Buggy code:
} if ( frameNumber == 10 ) { for ( int b = 0 ; b < 3 ; b ++ ) { totalShotsAtMiddle ++ ; if ( ballString [ b ] . equals ( "11111" ) ) { ( statValues [ 0 ] ) ++ ; ( statValues [ 1 ] ) ++ ; } else { int firstBall = StatsActivity . getStatIndexForBall ( ballString [ b ] ) ; if ( firstBall >= 0 ) ( statValues [ firstBall ] ) ++ ; if ( firstBall != ( - 1 ) ) ( statValues [ 0 ] ) ++ ; if ( ( b < 2 ) && ( ballString [ ( b + 1 ) ] . equals ( "11111" ) ) ) { ( statValues [ 2 ] ) ++ ; if ( firstBall >= 3 ) ( statSpared [ ( firstBall - 3 ) ] ) ++ ; } else { for ( int i = 0 ; i < 5 ; i ++ ) { if ( ( ballString [ 2 ] . charAt ( i ) ) == '0' ) { switch ( i ) { case 0 : case 4 : statValues [ 10 ] += 2 ; break ; case 1 : case 3 : statValues [ 10 ] += 3 ; break ; case 2 : statValues [ 10 ] += 5 ; break ; } } } break ; } } } } else { if ( ballString [ 0 ] . equals ( "11111" ) ) { ( statValues [ 1 ] ) ++ ; ( statValues [ 0 ] ) ++ ; } else { int firstBall = StatsActivity . getStatIndexForBall ( ballString [ 0 ] ) ; if ( firstBall >= 0 ) { ( statValues [ firstBall ] ) ++ ; } if ( firstBall != ( - 1 ) ) { ( statValues [ 0 ] ) ++ ; } if ( ballString [ 1 ] . equals ( "11111" ) ) { ( statValues [ 2 ] ) ++ ; if ( firstBall >= 3 ) ( statSpared [ ( firstBall - 3 ) ] ) ++ ; } else { for ( int i = 0 ; i < 5 ; i ++ ) { if ( ( ballString [ 2 ] . charAt ( i ) ) == '0' ) { switch ( i ) { case 0 : case 4 : statValues [ 10 ] += 2 ; break ; case 1 : case 3 : statValues [ 10 ] += 3 ; break ; case 2 : statValues [ 10 ] += 5 ; break ; } } } } } } cursor . moveToNext ( ) ; } } DecimalFormat decimalFormat = new DecimalFormat ( "##0.##" ) ; for ( int i = 0 ; i < ( StatsActivity . STATS_MIDDLE_GENERAL . length ) ; i ++ ) { stats [ i ] = ( ( ( ( stats [ i ] ) + ( decimalFormat . format ( ( ( ( statValues [ i ] ) // ( ( double ) ( totalShotsAtMiddle ) ) ) * 100 ) ) ) ) + "%<seq2seq4repair_space>[" ) + ( statValues [ i ] ) ) + "]" ; } final int startingStatIndex = StatsActivity . STATS_MIDDLE_GENERAL . length ; <START_BUG> for ( int i = 0 , currentStatIndex = 0 ; i < ( StatsActivity . STATS_MIDDLE_DETAILED . length ) ; i ++ , currentStatIndex += 2 ) { <END_BUG> stats [ ( startingStatIndex + currentStatIndex ) ] = ( ( ( ( stats [ ( startingStatIndex + currentStatIndex ) ] ) + ( decimalFormat . format ( ( ( ( statValues [ ( startingStatIndex + i ) ] ) // ( ( double ) ( totalShotsAtMiddle ) ) ) * 100 ) ) ) ) + "%<seq2seq4repair_space>[" ) + ( statValues [ ( startingStatIndex + i ) ] ) ) + "]" ; stats [ ( ( startingStatIndex + currentStatIndex ) + 1 ) ] = ( ( ( ( stats [ ( ( startingStatIndex + currentStatIndex ) + 1 ) ] ) + ( decimalFormat . format ( ( ( ( statSpared [ i ] ) // ( ( double ) ( ( statValues [ ( startingStatIndex + i ) ] ) > 0 ? statValues [ ( startingStatIndex + i ) ] : 1 ) ) ) * 100 ) ) ) ) + "%<seq2seq4repair_space>[" ) + ( statSpared [ i ] ) ) + "]" ; } stats [ 15 ] = ( stats [ 15 ] ) + ( statValues [ 9 ] ) ; stats [ 16 ] = ( stats [ 16 ] ) + ( statValues [ 10 ] ) ; List < String > statsList = new ArrayList < String > ( ) ; statsList . add ( ( "Bowler:<seq2seq4repair_space>" + ( bowlerName ) ) ) ; statsList . add ( ( "League:<seq2seq4repair_space>" + ( leagueName ) ) ) ; statsList . add ( ( "Game<seq2seq4repair_space>number:<seq2seq4repair_space>" + ( gameNumber ) ) ) ; statsList . addAll ( Arrays . asList ( stats ) ) ; ArrayAdapter < String > statsAdapter = new ArrayAdapter < String > ( this , layout . simple_list_item_1 , statsList ) ; ListView listView = ( ( ListView ) ( findViewById ( list_stats ) ) ) ; listView . setAdapter ( statsAdapter ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private Cursor getBowlerCursor ( ) { } private Cursor getLeagueCursor ( ) { } private Cursor getGameCursor ( ) { } private static int getStatIndexForBall ( String ball ) { } private static < T > T [ ] concatenateArrays ( T [ ] firstArray , T [ ] ... rest ) { } }

Fix:
for ( int i = 0 , currentStatIndex = 0 ; i < ( ( StatsActivity . STATS_MIDDLE_DETAILED . length ) // 2 ) ; i ++ , currentStatIndex += 2 ) {