Author: oheger
Date: Fri Feb 18 20:12:00 2011
New Revision: 1072124
URL: http://svn.apache.org/viewvc?rev=1072124&view=rev
Log:
[CONFIGURATION-363] Updated dependency to Commons Lang. With the new version of
StrSubstitutor interpolation in variable names is now possible. Ported fix to
configuration2 branch.
Modified:
commons/proper/configuration/branches/configuration2_experimental/pom.xml
commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
Modified:
commons/proper/configuration/branches/configuration2_experimental/pom.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/pom.xml?rev=1072124&r1=1072123&r2=1072124&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/pom.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/pom.xml
Fri Feb 18 20:12:00 2011
@@ -205,7 +205,7 @@
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
</dependency>
<dependency>
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml?rev=1072124&r1=1072123&r2=1072124&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/changes/changes.xml
Fri Feb 18 20:12:00 2011
@@ -79,6 +79,13 @@
</release>
<release version="1.7" date="in SVN" description="">
+ <action dev="oheger" type="fix" issue="CONFIGURATION-434">
+ HierarchicalINIConfiguration now recognizes comment characters in
+ property definitions only if they are preceded by whitespace. Thus
+ comment characters can now be part of the property value. This is for
+ instance required for the definition of file paths which use the
+ semicolon as path separator.
+ </action>
<action dev="oheger" type="fix" issue="CONFIGURATION-433">
Minor improvements of the support for indexed properties in
ConfigurationDynaBean.
@@ -174,6 +181,10 @@
Added MergeCombiner to allow elements in two configurations to be
merged when the
element and attributes in the first file match those in the second
file.
</action>
+ <action dev="oheger" type="add" issue="CONFIGURATION-363">
+ When using Commons Lang 2.6 or higher as dependency nested
interpolation
+ in variable names is supported.
+ </action>
<action dev="rgoers" type="add" issue="CONFIGURATION-340">
File system access has been abstracted to a FileSystem interface. Two
implementations
are provided, DefaultFileSystem that behaves in a backward compatible
manner and
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java?rev=1072124&r1=1072123&r2=1072124&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
Fri Feb 18 20:12:00 2011
@@ -388,6 +388,20 @@ public class TestAbstractConfigurationBa
}
/**
+ * Tests whether interpolation works in variable names.
+ */
+ public void testNestedVariableInterpolation()
+ {
+ BaseConfiguration config = new BaseConfiguration();
+ config.getSubstitutor().setEnableSubstitutionInVariables(true);
+ config.addProperty("java.version", "1.4");
+ config.addProperty("jre-1.4", "C:\\java\\1.4");
+ config.addProperty("jre.path", "${jre-${java.version}}");
+ assertEquals("Wrong path", "C:\\java\\1.4",
+ config.getString("jre.path"));
+ }
+
+ /**
* Creates the source configuration for testing the copy() and append()
* methods. This configuration contains keys with an odd index and values
* starting with the prefix "src". There are also some list properties.