@@ -353,18 +353,16 @@ public static ConfigProvider createDefault() {
353353 Properties configProperties =
354354 loadConfigurationFile (
355355 new ConfigProvider (new SystemPropertiesConfigSource (), new EnvironmentConfigSource ()));
356- // MIKAYLA: What is the significance of configProperties, of this isEmpty check?
357356 if (configProperties .isEmpty ()) {
358357 return new ConfigProvider (
359358 new SystemPropertiesConfigSource (),
360359 new StableConfigSource (
361360 StableConfigSource .MANAGED_STABLE_CONFIG_PATH , ConfigOrigin .MANAGED_STABLE_CONFIG ),
362361 new EnvironmentConfigSource (),
363362 new OtelEnvironmentConfigSource (),
364- new CapturedEnvironmentConfigSource (), // MIKAYLA: what is
365- // CapturedEnvironmentConfigSource?
366363 new StableConfigSource (
367- StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ));
364+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
365+ new CapturedEnvironmentConfigSource ());
368366 } else {
369367 return new ConfigProvider (
370368 new SystemPropertiesConfigSource (),
@@ -373,9 +371,9 @@ public static ConfigProvider createDefault() {
373371 new EnvironmentConfigSource (),
374372 new PropertiesConfigSource (configProperties , true ),
375373 new OtelEnvironmentConfigSource (configProperties ),
376- new CapturedEnvironmentConfigSource (),
377374 new StableConfigSource (
378- StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ));
375+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
376+ new CapturedEnvironmentConfigSource ());
379377 }
380378 }
381379
@@ -392,9 +390,9 @@ public static ConfigProvider withoutCollector() {
392390 StableConfigSource .MANAGED_STABLE_CONFIG_PATH , ConfigOrigin .MANAGED_STABLE_CONFIG ),
393391 new EnvironmentConfigSource (),
394392 new OtelEnvironmentConfigSource (),
395- new CapturedEnvironmentConfigSource (),
396393 new StableConfigSource (
397- StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ));
394+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
395+ new CapturedEnvironmentConfigSource ());
398396 } else {
399397 return new ConfigProvider (
400398 false ,
@@ -404,35 +402,43 @@ public static ConfigProvider withoutCollector() {
404402 new EnvironmentConfigSource (),
405403 new PropertiesConfigSource (configProperties , true ),
406404 new OtelEnvironmentConfigSource (configProperties ),
407- new CapturedEnvironmentConfigSource (),
408405 new StableConfigSource (
409- StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ));
406+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
407+ new CapturedEnvironmentConfigSource ());
410408 }
411409 }
412410
413- // MIKAYLA: What is providedConfigSource, and how should it stand up against stableconfig?
414411 public static ConfigProvider withPropertiesOverride (Properties properties ) {
415412 PropertiesConfigSource providedConfigSource = new PropertiesConfigSource (properties , false );
416413 Properties configProperties =
417414 loadConfigurationFile (
418415 new ConfigProvider (
419416 new SystemPropertiesConfigSource (),
417+ // MIKAYLA: To add StableConfig?
420418 new EnvironmentConfigSource (),
421419 providedConfigSource ));
422420 if (configProperties .isEmpty ()) {
423421 return new ConfigProvider (
424422 new SystemPropertiesConfigSource (),
423+ new StableConfigSource (
424+ StableConfigSource .MANAGED_STABLE_CONFIG_PATH , ConfigOrigin .MANAGED_STABLE_CONFIG ),
425425 new EnvironmentConfigSource (),
426426 providedConfigSource ,
427427 new OtelEnvironmentConfigSource (),
428+ new StableConfigSource (
429+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
428430 new CapturedEnvironmentConfigSource ());
429431 } else {
430432 return new ConfigProvider (
431433 providedConfigSource ,
432434 new SystemPropertiesConfigSource (),
435+ new StableConfigSource (
436+ StableConfigSource .MANAGED_STABLE_CONFIG_PATH , ConfigOrigin .MANAGED_STABLE_CONFIG ),
433437 new EnvironmentConfigSource (),
434438 new PropertiesConfigSource (configProperties , true ),
435439 new OtelEnvironmentConfigSource (configProperties ),
440+ new StableConfigSource (
441+ StableConfigSource .USER_STABLE_CONFIG_PATH , ConfigOrigin .USER_STABLE_CONFIG ),
436442 new CapturedEnvironmentConfigSource ());
437443 }
438444 }
0 commit comments