You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Joseph (JIRA)" <ji...@apache.org> on 2013/05/03 14:40:15 UTC

[jira] [Updated] (FELIX-4047) Unable to create empty or single valued String array property

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

Thomas Joseph updated FELIX-4047:
---------------------------------

    Description: 
There is no way that I can declare an empty or a single valued String array is property.
{code}
@Property(label="Multivalued Property", value={"only-single-value"})
private static final String MV_PROPERTY= "multivalued.property";
{code}

OR

@Property(label="Multivalued Property", value={"only-single-value"}, unbounded=PropertyUnbounded.ARRAY)
private static final String MV_PROPERTY= "multivalued.property";

OR

@Property(label="Multivalued Property", value={"only-single-value"}, cardinality=N)
private static final String MV_PROPERTY= "multivalued.property";

All would generate the same DS XML file as:
<property name="multivalued.property" value="only-single-value"/>


As of now the only workaround is to declare an array with at-least two entries:

@Property(label="Multivalued Property", value={"only-single-value", ""})
private static final String MV_PROPERTY= "multivalued.property";

OR

@Property(label="Multivalued Property", value={"", ""})
private static final String MV_PROPERTY= "multivalued.property";

  was:
There is no way that I can declare an empty or a single valued String array is property.
{pre}
@Property(label="Multivalued Property", value={"only-single-value"})
private static final String MV_PROPERTY= "multivalued.property";
{pre}

OR

@Property(label="Multivalued Property", value={"only-single-value"}, unbounded=PropertyUnbounded.ARRAY)
private static final String MV_PROPERTY= "multivalued.property";

OR

@Property(label="Multivalued Property", value={"only-single-value"}, cardinality=N)
private static final String MV_PROPERTY= "multivalued.property";

All would generate the same DS XML file as:
<property name="multivalued.property" value="only-single-value"/>


As of now the only workaround is to declare an array with at-least two entries:

@Property(label="Multivalued Property", value={"only-single-value", ""})
private static final String MV_PROPERTY= "multivalued.property";

OR

@Property(label="Multivalued Property", value={"", ""})
private static final String MV_PROPERTY= "multivalued.property";

    
> Unable to create empty or single valued String array property
> -------------------------------------------------------------
>
>                 Key: FELIX-4047
>                 URL: https://issues.apache.org/jira/browse/FELIX-4047
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.8.0, maven-scr-plugin-1.12.0
>            Reporter: Thomas Joseph
>
> There is no way that I can declare an empty or a single valued String array is property.
> {code}
> @Property(label="Multivalued Property", value={"only-single-value"})
> private static final String MV_PROPERTY= "multivalued.property";
> {code}
> OR
> @Property(label="Multivalued Property", value={"only-single-value"}, unbounded=PropertyUnbounded.ARRAY)
> private static final String MV_PROPERTY= "multivalued.property";
> OR
> @Property(label="Multivalued Property", value={"only-single-value"}, cardinality=N)
> private static final String MV_PROPERTY= "multivalued.property";
> All would generate the same DS XML file as:
> <property name="multivalued.property" value="only-single-value"/>
> As of now the only workaround is to declare an array with at-least two entries:
> @Property(label="Multivalued Property", value={"only-single-value", ""})
> private static final String MV_PROPERTY= "multivalued.property";
> OR
> @Property(label="Multivalued Property", value={"", ""})
> private static final String MV_PROPERTY= "multivalued.property";

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira