Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The Property class is the key of the Map in Configuration class but it doesn't override hashcode and equals methods. #8

@gitika-bansal

Description

@gitika-bansal

It is not possible to retrieve a property's value from the Configuration object if the reference to the original property object used in ConfigurationTemplate is lost.

eg:
fun main(args: Array) {
val config = ConfigurationTemplate().withProp(Property.string("MY_PROP"),"myprop").reify()
val propValue = config.get(Property.string("MY_PROP"))
println(propValue)
}

gives Exception in thread "main" io.github.konfigur8.Misconfiguration: Unknown configuration key 'MY_PROP'
Instead, it should provide the value from environment or the default "myprop"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions