[Jenkins] Sling » sling-org-apache-sling-launchpad-testing » master #399 is FIXED

2019-11-16 Thread Apache Jenkins Server
Please see 
https://builds.apache.org/job/Sling/job/sling-org-apache-sling-launchpad-testing/job/master/399/
 for details.

No further emails will be sent until the status of the build is changed.

[jira] [Commented] (SLING-8706) Injections for java.util.Optional<> should be automatic optional

2019-11-16 Thread Evgeny Tugarev (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975777#comment-16975777
 ] 

Evgeny Tugarev commented on SLING-8706:
---

Thanks for the detailed explanation, [~joerghoh] I'll start with the 
implementation.

> Injections for java.util.Optional<> should be automatic optional 
> -
>
> Key: SLING-8706
> URL: https://issues.apache.org/jira/browse/SLING-8706
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Models
>Reporter: Jörg Hoh
>Priority: Major
>
> The current approach to support optional injections requires to annotate the 
> field with {{@Optional}} plus proper handling within the javacode (null 
> checks etc), which can be forgotten.
> So instead of
> {code}
> @Inject @Optional
> String fieldname;
> {code}
> it should also be possible to use this
> {code}
> @Inject
> Optional fieldname;
> {code}
> with the very same semantic. But the developer is forced to deal with the 
> case that the value is not present.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)