@@ -196,7 +196,7 @@ public DatafileProjectConfig(String accountId,
196196 allExperiments .addAll (aggregateGroupExperiments (groups ));
197197
198198 // Inject "everyone else" variation into feature_rollout experiments
199- allExperiments = injectFeatureRolloutVariations (allExperiments , this .featureFlags );
199+ allExperiments = injectFeatureRolloutVariations (allExperiments , this .featureFlags , this . rollouts );
200200
201201 this .experiments = Collections .unmodifiableList (allExperiments );
202202
@@ -368,12 +368,21 @@ public Experiment getExperimentForVariationId(String variationId) {
368368 */
369369 private List <Experiment > injectFeatureRolloutVariations (
370370 List <Experiment > allExperiments ,
371- List <FeatureFlag > featureFlags
371+ List <FeatureFlag > featureFlags ,
372+ List <Rollout > rollouts
372373 ) {
373374 if (featureFlags == null || featureFlags .isEmpty ()) {
374375 return allExperiments ;
375376 }
376377
378+ // Build rollout ID to Rollout mapping
379+ Map <String , Rollout > rolloutMap = new HashMap <>();
380+ if (rollouts != null ) {
381+ for (Rollout rollout : rollouts ) {
382+ rolloutMap .put (rollout .getId (), rollout );
383+ }
384+ }
385+
377386 // Build experiment ID to index mapping for quick lookup
378387 Map <String , Integer > experimentIndexMap = new HashMap <>();
379388 for (int i = 0 ; i < allExperiments .size (); i ++) {
@@ -383,7 +392,7 @@ private List<Experiment> injectFeatureRolloutVariations(
383392 List <Experiment > updatedExperiments = new ArrayList <>(allExperiments );
384393
385394 for (FeatureFlag flag : featureFlags ) {
386- Variation everyoneElseVariation = getEveryoneElseVariation (flag , this . rolloutIdMapping );
395+ Variation everyoneElseVariation = getEveryoneElseVariation (flag , rolloutMap );
387396 if (everyoneElseVariation == null ) {
388397 continue ;
389398 }
0 commit comments