Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 34347 invoked from network); 6 Feb 2009 13:24:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2009 13:24:28 -0000 Received: (qmail 14908 invoked by uid 500); 6 Feb 2009 13:24:23 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 14818 invoked by uid 500); 6 Feb 2009 13:24:23 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 14749 invoked by uid 99); 6 Feb 2009 13:24:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 05:24:23 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 13:24:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9A80F234C4AB for ; Fri, 6 Feb 2009 05:23:59 -0800 (PST) Message-ID: <777373899.1233926639631.JavaMail.jira@brutus> Date: Fri, 6 Feb 2009 05:23:59 -0800 (PST) From: "Rob Walker (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (CONFIGURATION-364) Enhance StrSubstitutor to support nested ${var-${subvr}} expansion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Enhance StrSubstitutor to support nested ${var-${subvr}} expansion ------------------------------------------------------------------ Key: CONFIGURATION-364 URL: https://issues.apache.org/jira/browse/CONFIGURATION-364 Project: Commons Configuration Issue Type: Improvement Reporter: Rob Walker It 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.