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

Closed
spring-projects-issues opened this issue May 31, 2018 · 0 comments
Closed

Revisit PropertyResolver Kotlin extensions [SPR-16883] #21422

spring-projects-issues opened this issue May 31, 2018 · 0 comments
Assignees
Labels
in: core type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues 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

@spring-projects-issues spring-projects-issues added type: enhancement in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.1 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants