Fix flag app being empty.
Kotlin evaluates `object` declarations lazily. We have to access `Flags` before it will populate the list, and we were asking for the list during construction of our dagger graph. Bug: 257302229 Test: manual Change-Id: Iadfbbbc50ee2fb09260f5d119898fb50b3cc90f9
This commit is contained in:
@@ -22,7 +22,11 @@ object FlagsFactory {
|
||||
private val flagMap = mutableMapOf<String, Flag<*>>()
|
||||
|
||||
val knownFlags: Map<String, Flag<*>>
|
||||
get() = flagMap
|
||||
get() {
|
||||
// We need to access Flags in order to initialize our map.
|
||||
assert(flagMap.contains(Flags.TEAMFOOD.name)) { "Where is teamfood?" }
|
||||
return flagMap
|
||||
}
|
||||
|
||||
fun unreleasedFlag(
|
||||
id: Int,
|
||||
|
||||
@@ -22,7 +22,11 @@ object FlagsFactory {
|
||||
private val flagMap = mutableMapOf<String, Flag<*>>()
|
||||
|
||||
val knownFlags: Map<String, Flag<*>>
|
||||
get() = flagMap
|
||||
get() {
|
||||
// We need to access Flags in order to initialize our map.
|
||||
assert(flagMap.contains(Flags.TEAMFOOD.name)) { "Where is teamfood?" }
|
||||
return flagMap
|
||||
}
|
||||
|
||||
fun unreleasedFlag(
|
||||
id: Int,
|
||||
|
||||
Reference in New Issue
Block a user