felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Jencks (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5404) Annotation configurations default values are not considered
Date Wed, 21 Dec 2016 18:01:05 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15767689#comment-15767689

David Jencks commented on FELIX-5404:

There's no way to represent an empty array as a bunch of key=value pairs, so I think bnd is
working correctly in that case.  I don't recall why the default value for an array valued
method is null rather than an empty array.  If you don't want to live with the IDE warnings
about null checks you might investigate using felix/bnd extensions so you can use an interface
instead of an annotation for the configuration properties.

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

View raw message