Revisit PropertyResolver Kotlin extensions [SPR-16883] #21422
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Sébastien Deleuze opened SPR-16883 and commented
Currently the
get
operator extension forPropertyResolver
used to access for example onEnvironnement
is callinggetRequiredProperty
which prevents to use Kotlin null safety to get default value likeval name = env["name"] ?: "default"
.This issue intend to use
getProperty
instead ofgetRequiredProperty
to achieve this behavior. This is a breaking change but I think this is worth doing it since use case of nullable return value + fallback seems to be very common based on Kotlin developer feedback.This issue also introduce
getProperty<Foo>(...)
andgetRequiredProperty<Foo>(...)
Kotlin extensions.Referenced from: commits a7a29a8
The text was updated successfully, but these errors were encountered: