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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to