Uploaded image for project: 'Cactus'
  1. Cactus
  2. CACTUS-206

cactus.sysproperties space delimiter in property file can be confusing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Maven Integration
    • None

    Description

      The use of the space as a delimiter for cactus.sysproperties can cause unanticipated failures which may be extremely difficult to debug.

      Consider the following example, with the property names split over multiple lines for clarity:

      cactus.sysproperties=\
      propertya\
      propertyb\
      propertyc
      propertya=something
      propertyb=something
      propertyc=something

      This will only work correctly if the indentation is done with spaces. If the three values are indented with tabs, property[abc] will not be set (because, I think, util:tokenize will be attempting to work with the string \n\tpropertya\n\tpropertyb\n\tpropertyc which contains no spaces.

      I suggest adding an additional key in the plugin.properties, such as

      cactus.sysproperties.delimiter=SPACE

      and changing the relevant portions (three of them) of plugin.jelly to:

      <!-- Pass any user-defined system properties -->
      <j:set var="syspropDelim" value="${cactus.sysproperties.delimiter}"/>
      <j:if test="${syspropDelim == 'SPACE'}">
      <j:set var="syspropDelim" value=" "/>
      </j:if>

      <util:tokenize var="listOfProperties" delim="${syspropDelim}">${cactus.sysproperties}</util:tokenize>

      This allows a user to set the property

      cactus.sysproperties.delimiter=,

      and then the following example works properly even using tabs:

      cactus.sysproperties=\
      propertya,\
      propertyb,\
      propertyc
      propertya=something
      propertyb=something
      propertyc=something

      Of course, you could just change the delimiter, but this approach would allow existing applications to work properly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            thierrylach thierry lach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: