You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by "Felipe Leme (JIRA)" <ca...@jakarta.apache.org> on 2005/10/19 15:35:45 UTC

[jira] Commented: (CACTUS-206) cactus.sysproperties space delimiter in property file can be confusing

    [ http://issues.apache.org/jira/browse/CACTUS-206?page=comments#action_12332475 ] 

Felipe Leme commented on CACTUS-206:
------------------------------------

On a second thought, using an external file could be confusing for the user, as that file would typically have a .properties extension but it would not be a properties file (as it would only contain the names, not the values).

Vincent,is there  any reason (other than breaking backwards compatibility) for not using a comma-related list?

-- Felipe


> cactus.sysproperties space delimiter in property file can be confusing
> ----------------------------------------------------------------------
>
>          Key: CACTUS-206
>          URL: http://issues.apache.org/jira/browse/CACTUS-206
>      Project: Cactus
>         Type: Improvement
>   Components: Maven Integration
>     Reporter: thierry lach
>     Priority: Minor

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org