Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4047

Unable to create empty or single valued String array property

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: maven-scr-plugin-1.8.0, maven-scr-plugin-1.12.0
    • Fix Version/s: scr annotations 1.9.4
    • Component/s: SCR Tooling
    • Labels:
      None

      Description

      There is no way that I can declare an empty or a single valued String array property.

      @Property(label="Multivalued Property", value=

      {"only-single-value"})
      private static final String MV_PROPERTY= "multivalued.property";


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

        Attachments

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              ethomasjoseph Thomas Joseph
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: