Would you consider having `Enum<E>.qualifier...
# koin
e
Would you consider having
Enum<E>.qualifier
relating to the default Locale is dangerous?
☝️ 2
I mean
Copy code
val <E : Enum<E>> Enum<E>.qualifier
    get(): Qualifier {
        return StringQualifier(this.toString().toLowerCase())
    }
is locale specific. Maybe use
.lowercase()
that is using
Locale.ROOT
?
l
what's the matter with using
.name()
and calling it a day?
e
That would probably be a breaking change. But I'm fine with it
l
Ah, you mean on Koin itself. For some reason I thought this was you function
e
It is koin code
l
I think it wouldn't be a problem until the Locale is changed during runtime, and even in that case my guess is that the tree is just rebuilt with the new qualifier. I guess it's also very unlikely to get 'bad' names coming from enum constants, but many things are allowed xD Is it dangerous? I'd say no. Most likely not. Is it correct? No. The implementation could probably address these corner cases and others
e
Haha, we had a bug where the qualifier was saved in JSON. And that gave us problems.
l
Like having user in country A producing a different qualifier than user in country B, and then crossing data around didn't fit? In that case, still not dangerous, but worthy of an issue 😄
e
User in the same country but has a Turkish locale. Anyway, I will better create a ticket in the koin GitHub with all details.