summaryrefslogtreecommitdiffstats
path: root/container-di
diff options
context:
space:
mode:
authorgjoranv <gv@oath.com>2018-04-09 11:59:18 +0200
committergjoranv <gv@oath.com>2018-04-09 11:59:18 +0200
commita17495e7ead2a728369a7c1b9a75c0d52a1d85d3 (patch)
treeef3ee490e4fb6657fc913f1dc193e8c7561d7552 /container-di
parentf7f89419cc6e91045b520244e9cc128db647c04e (diff)
Replace assumed dead code branch with require statement.
Diffstat (limited to 'container-di')
-rw-r--r--container-di/src/main/scala/com/yahoo/container/di/Container.scala15
1 files changed, 5 insertions, 10 deletions
diff --git a/container-di/src/main/scala/com/yahoo/container/di/Container.scala b/container-di/src/main/scala/com/yahoo/container/di/Container.scala
index 50ebff6ece9..5ea6422ddad 100644
--- a/container-di/src/main/scala/com/yahoo/container/di/Container.scala
+++ b/container-di/src/main/scala/com/yahoo/container/di/Container.scala
@@ -126,7 +126,11 @@ class Container(
val preventTailRecursion =
snapshot match {
- case BootstrapConfigs(configs) if getBootstrapGeneration > previousConfigGeneration =>
+ case BootstrapConfigs(configs) =>
+ // TODO: remove require when proven unnecessary
+ require(getBootstrapGeneration > previousConfigGeneration,
+ """Got bootstrap configs out of sequence for old config generation %d.
+ |Previous config generation is %d""".format(getBootstrapGeneration, previousConfigGeneration))
log.log(DEBUG,
"""Got new bootstrap generation
|bootstrap generation = %d
@@ -137,15 +141,6 @@ class Container(
createNewGraph(
createComponentsGraph(configs, getBootstrapGeneration,fallbackInjector),
fallbackInjector)
- case BootstrapConfigs(_) =>
- // This is an assumed dead code branch, most likely remains from before config set subscriptions were available.
- log.warning(
- """Got bootstrap configs with previous generation. (This should not happen.)
- |bootstrap generation = %d
- |components generation: %d
- |previous generation: %d"""
- .format(getBootstrapGeneration, getComponentsGeneration, previousConfigGeneration).stripMargin)
- createNewGraph(graph, fallbackInjector)
case ComponentsConfigs(configs) =>
log.log(DEBUG,
"""Got components configs,