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/22 21:36:40 UTC

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

etugarev 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-557703449
 
 
   Posting here a "work in progress". 
   As discussed before I have modified a `ModelAdapterFactory.injectElement(..)`to incorporate the `Optional<>` class. I changed `ModelAdapterFactory.injectElement(..)` to be a facade and moved its original logic to `ModelAdapterFactory.injectElementInternal(..)`.
    An additional method `getElement()` was created in order "represent" an optional `InjectableElement`. Also a specific version of `injectElementInternal()` is in place to fulfil the injection. Few questions regarding this change:
   
   1. Does it look legitimate?
   2. How to deal with the presence of `@Optional` annotation if field is marked as Optional<>?

----------------------------------------------------------------
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