You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Jencks (JIRA)" <ji...@apache.org> on 2016/12/20 00:01:58 UTC

[jira] [Reopened] (FELIX-5404) Annotation configurations default values are not considered

     [ https://issues.apache.org/jira/browse/FELIX-5404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Jencks reopened FELIX-5404:
---------------------------------

My opinion is that this is not spec compliant. 112.8.2 says

At build time, the component property types must be processed to potentially generate property ele- ments in the component description. See Ordering of Generated Properties on page 218.
At runtime, when SCR needs to call a lifecycle method on a component instance which takes an ar- gument whose type is a component property type, SCR must construct an instance of the compo- nent property type whose methods are backed by the values of the component properties for the component instance. This object is then passed to the life cycle method which can use the object to obtain the property values in a type safe manner.

---

I think this states that the annotation methods are backed by the component properties, not by annotation default values.  I may not have explained the situation properly, but I think BJ agrees with my interpretation.

> Annotation configurations default values are not considered
> -----------------------------------------------------------
>
>                 Key: FELIX-5404
>                 URL: https://issues.apache.org/jira/browse/FELIX-5404
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-2.0.6
>            Reporter: Julian Sedding
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: scr-2.1.0
>
>         Attachments: FELIX-5404-integration-test-jsedding.patch, FELIX-5404-jsedding.patch
>
>
> When an annotation is used to configure an SCR component (as per DS 1.3), the annotation's default values are not considered.
> This can lead to the odd situation that an annotation method with a default value returns null. I'm not sure if this violates a contract or another, however, my IDE complains when I do a null check.
> I think it would be the right thing to do to return the default value if no value is explicitly configured.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)