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

ResolvableType.forInstance should return NONE for null instance #28776

Closed
jhoeller opened this issue Jul 8, 2022 · 2 comments
Closed

ResolvableType.forInstance should return NONE for null instance #28776

jhoeller opened this issue Jul 8, 2022 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

jhoeller commented Jul 8, 2022

ResolvableType.forInstance(Object) enforces a not-null argument which makes it unpleasant to use with input that can come from a nullable source (or even just an API call which in some circumstances may return null and is therefore marked as @Nullable, even if never actually null in a given usage scenario). A more usage-friendly variant is to accept null but turn it into ResolvableType.NONE.

@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jul 8, 2022
@jhoeller jhoeller added this to the 5.3.22 milestone Jul 8, 2022
@jhoeller jhoeller self-assigned this Jul 8, 2022
@salmansharifov
Copy link

@jhoeller Can I take this issue?

@jhoeller
Copy link
Contributor Author

@salmansharifov Thanks for volunteering but I got this locally prepared along with a few other backports to 5.3.22 already, to be committed today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants