Buggy code:
if ( ! ( context . getTimeIndex ( ) . intersects ( timeRange ) ) ) { solutionLog . log ( WARN , "No<seq2seq4repair_space>time<seq2seq4repair_space>index<seq2seq4repair_space>intersection.<seq2seq4repair_space>Partition<seq2seq4repair_space>{}:<seq2seq4repair_space>{}<seq2seq4repair_space>doesn't<seq2seq4repair_space>intersect<seq2seq4repair_space>with<seq2seq4repair_space>{}" , handle . getCoord ( ) . partitionId , context . getTimeIndex ( ) , timeRange ) ; StrutAnswer answer = strut . composeAnswer ( context , request , Collections . emptyList ( ) , ( report . isPresent ( ) ? report . get ( ) . threshold : 0.0F ) ) ; return new MiruPartitionResponse ( answer , solutionLog . asList ( ) ) ; } int activityIndexLastId = context . getActivityIndex ( ) . lastId ( stackBuffer ) ; List < IBM > ands = new ArrayList < > ( ) ; ands . add ( bitmaps . buildIndexMask ( activityIndexLastId , context . getRemovalIndex ( ) . getIndex ( stackBuffer ) ) ) ; MiruSchema schema = context . getSchema ( ) ; MiruTermComposer termComposer = context . getTermComposer ( ) ; if ( ! ( NO_FILTER . equals ( request . query . constraintFilter ) ) ) { BM constrained = aggregateUtil . filter ( "strutGather" , bitmaps , schema , termComposer , context . getFieldIndexProvider ( ) , request . query . constraintFilter , solutionLog , null , activityIndexLastId , ( - 1 ) , stackBuffer ) ; ands . add ( constrained ) ; } if ( ! ( NOT_PROVIDED . equals ( request . authzExpression ) ) ) { ands . add ( context . getAuthzIndex ( ) . getCompositeAuthz ( request . authzExpression , stackBuffer ) ) ; } if ( ! ( ALL_TIME . equals ( request . query . timeRange ) ) ) { ands . add ( bitmaps . buildTimeRangeMask ( context . getTimeIndex ( ) , timeRange . smallestTimestamp , timeRange . largestTimestamp , stackBuffer ) ) ; } ands . add ( bitmaps . buildIndexMask ( activityIndexLastId , context . getRemovalIndex ( ) . getIndex ( stackBuffer ) ) ) ; bitmapsDebug . debug ( solutionLog , bitmaps , "ands" , ands ) ; BM eligible = bitmaps . and ( ands ) ; int pivotFieldId = schema . getFieldId ( request . query . constraintField ) ; BM constrainFeature ; if ( ! ( NO_FILTER . equals ( request . query . featureFilter ) ) ) { constrainFeature = aggregateUtil . filter ( "strutFeature" , bitmaps , schema , termComposer , context . getFieldIndexProvider ( ) , request . query . featureFilter , solutionLog , null , activityIndexLastId , ( - 1 ) , stackBuffer ) ; } else { constrainFeature = null ; } MiruFieldIndex < BM , IBM > primaryIndex = context . getFieldIndexProvider ( ) . getFieldIndex ( primary ) ; float [ ] thresholds = ( report . isPresent ( ) ) ? new float [ ] { report . get ( ) . threshold } : new float [ ] { 0.5F , 0.2F , 0.08F , 0.0F } ; @ SuppressWarnings ( "unchecked" ) MinMaxPriorityQueue < Scored > [ ] scored = new MinMaxPriorityQueue [ thresholds . length ] ; for ( int i = 0 ; i < ( thresholds . length ) ; i ++ ) { scored [ i ] = MinMaxPriorityQueue . expectedSize ( request . query . desiredNumberOfResults ) . maximumSize ( request . query . desiredNumberOfResults ) . create ( ) ; } MiruPluginCacheProvider . CacheKeyValues cacheStores = handle . getRequestContext ( ) . getCacheProvider ( ) . get ( ( "strut-" + ( request . query . catwalkId ) ) , 8 , false ) ; StrutModelScorer modelScorer = new StrutModelScorer ( ) ; List < Scored > updates = Lists . newArrayList ( ) ; strut . yourStuff ( "strut" , handle . getCoord ( ) , bitmaps , context , request , report , ( streamBitmaps ) -> { long start = System . currentTimeMillis ( ) ; List < LastIdAndTermId > lastIdAndTermIds = Lists . newArrayList ( ) ; aggregateUtil . gather ( "strut" , bitmaps , context , eligible , pivotFieldId , 100 , solutionLog , ( lastId , termId ) -> { lastIdAndTermIds . add ( new LastIdAndTermId ( lastId , termId ) ) ; return true ; } , stackBuffer ) ; solutionLog . log ( MiruSolutionLogLevel . INFO , "Strut<seq2seq4repair_space>accumulated<seq2seq4repair_space>{}<seq2seq4repair_space>terms<seq2seq4repair_space>in<seq2seq4repair_space>{}<seq2seq4repair_space>ms" , lastIdAndTermIds . size ( ) , ( ( System . currentTimeMillis ( ) ) - start ) ) ; start = System . currentTimeMillis ( ) ; long totalTimeFetchingLastId = 0 ; long totalTimeFetchingScores = 0 ; int batchSize = 100 ; BM [ ] answers = bitmaps . createArrayOf ( batchSize ) ; int [ ] scoredToLastIds = new int [ batchSize ] ; MiruTermId [ ] nullableMiruTermIds = new MiruTermId [ batchSize ] ; MiruTermId [ ] miruTermIds = new MiruTermId [ batchSize ] ; int totalMisses = 0 ; done : for ( List < LastIdAndTermId > batch : Lists . partition ( lastIdAndTermIds , answers . length ) ) { Arrays . fill ( miruTermIds , null ) ; <START_BUG> for ( int i = 0 ; i < batchSize ; i ++ ) { <END_BUG>

Fix:
for ( int i = 0 ; i < ( batch . size ( ) ) ; i ++ ) {