You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2019/11/17 18:05:05 UTC

[GitHub] [sling-org-apache-sling-models-impl] paul-bjorkstrand edited a comment on issue #17: SLING-8706 - Injections for java.util.Optional<> should be automatically optional

paul-bjorkstrand edited a comment on issue #17: SLING-8706 - Injections for java.util.Optional<> should be automatically optional
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/17#issuecomment-554768731
 
 
   My concern with this impl that it only applies to `@ValueMapValue` injections, and not other injectors (`@ChildResource` or `@RequestAttribute` to name a couple, not to mention the custom ones out there). I wonder if there is a way to make `Optional<..>` work for all injectors, without the need to modify each individual injector.
   
   It will likely require a change to `ModelAdapterFactory.injectElement(..)` that detects `Optional<..>` and does a recursive call. with the type extracted from the field's generic params.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services