Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit PropertyResolver Kotlin extensions [SPR-16883] #21422

spring-issuemaster opened this issue May 31, 2018 · 0 comments

Revisit PropertyResolver Kotlin extensions [SPR-16883] #21422

spring-issuemaster opened this issue May 31, 2018 · 0 comments


Copy link

@spring-issuemaster spring-issuemaster commented May 31, 2018

Sébastien Deleuze opened SPR-16883 and commented

Currently the get operator extension for PropertyResolver used to access for example on Environnement is calling getRequiredProperty which prevents to use Kotlin null safety to get default value like val name = env["name"] ?: "default".

This issue intend to use getProperty instead of getRequiredProperty 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>(...) and getRequiredProperty<Foo>(...) Kotlin extensions.

Referenced from: commits a7a29a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.