commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Walker (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-482) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion
Date Mon, 01 Mar 2010 20:16:05 GMT

    [ https://issues.apache.org/jira/browse/LANG-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839833#action_12839833
] 

Rob Walker commented on LANG-482:
---------------------------------

We find them useful and use them extensively. If others have objections to them or don't find
them useful, it's not really a big deal for us. We've got this work applied to our locally
customised version anyhow, so we'll just keep re-applying it whenever we upgrade the root
Apache version.

> Enhance StrSubstitutor to support nested ${var-${subvr}} expansion
> ------------------------------------------------------------------
>
>                 Key: LANG-482
>                 URL: https://issues.apache.org/jira/browse/LANG-482
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.text.*
>            Reporter: Rob Walker
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: StrSubstitutor.java.nested.patch
>
>
> t would be really handy of StrSubstitutor could support nested variable interpolation:
> org.osgi.framework.system.packages=org.osgi.framework; version=1.4.0, \
> org.osgi.service.packageadmin; version=1.2.0, \
> org.osgi.service.startlevel; version=1.1.0, \
> org.osgi.service.url; version=1.0.0, \
> org.osgi.util.tracker; version=1.3.3 \
> ${jre-${java.specification.version}}
> The process being to expand innermost variable references first and work outwards - this
allows for very advance config, such as the above, which can dynamically detect the Java version
and expand a JRE version specific property into the property being defined.
> Looking at the implementation, it seems it might be a fairly straightforward enhancement
to:
> private int substitute(StrBuilder buf, int offset, int length, List priorVariables)
> The code already has the cyclic map in place.
> I already have code that achieves this within Apache Felix, so I will see if I can retro-fit
a similar model to the above and if so submit a patch. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message