[jira] Updated: (LANG-482) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion

2010-10-03 Thread Oliver Heger (JIRA)

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

Oliver Heger updated LANG-482:
--

Attachment: lang-482.diff

Patch for implementing the described functionality including additional unit 
tests. The existing tests pass.

Note: The patch contains some minor formatting noise in the test class (mainly 
trailing spaces were removed), but I think this is acceptable.

> 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: lang-482.diff, 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.



[jira] Updated: (LANG-482) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion

2010-01-16 Thread Henri Yandell (JIRA)

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

Henri Yandell updated LANG-482:
---

Fix Version/s: (was: 3.0)
   3.x

Moving to 3.x for now.

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



[jira] Updated: (LANG-482) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion

2009-02-27 Thread Henri Yandell (JIRA)

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

Henri Yandell updated LANG-482:
---

Fix Version/s: 3.0

+1 to the idea.

> 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
>Reporter: Rob Walker
>Priority: Minor
> Fix For: 3.0
>
> 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.



[jira] Updated: (LANG-482) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion

2009-02-06 Thread Rob Walker (JIRA)

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

Rob Walker updated LANG-482:


Attachment: StrSubstitutor.java.nested.patch

Attached is a provisional patch that seems to work for this.

It works for a pretty good array of tests that I have here, plus seems to catch 
the recursion nasty. Will continue with more checks against our apps usage via 
Commons Configuration next week

> 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
>Reporter: Rob Walker
>Priority: Minor
> 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.