You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oh...@apache.org on 2005/08/31 20:46:00 UTC
svn commit: r265545 - in /jakarta/commons/proper/configuration/trunk:
src/java/org/apache/commons/configuration/AbstractConfiguration.java
src/test/org/apache/commons/configuration/TestBaseConfiguration.java
xdocs/changes.xml
Author: oheger
Date: Wed Aug 31 11:45:44 2005
New Revision: 265545
URL: http://svn.apache.org/viewcvs?rev=265545&view=rev
Log:
Updated interpolation mechanism to only use the first value of a multi-valued property
Modified:
jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfiguration.java
jakarta/commons/proper/configuration/trunk/xdocs/changes.xml
Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java?rev=265545&r1=265544&r2=265545&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java Wed Aug 31 11:45:44 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
@@ -198,7 +198,7 @@
priorVariables.add(variable);
}
- Object value = getProperty(variable);
+ Object value = resolveContainerStore(variable);
if (value != null)
{
result.append(interpolateHelper(value.toString(), priorVariables));
Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfiguration.java?rev=265545&r1=265544&r2=265545&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfiguration.java (original)
+++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfiguration.java Wed Aug 31 11:45:44 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
@@ -570,6 +570,10 @@
"check first entry was interpolated",
"/home/applicationRoot/1",
arrayInt[0]);
+
+ config.addProperty("path", "/temp,C:\\Temp,/usr/local/tmp");
+ config.setProperty("path.current", "${path}");
+ assertEquals("Interpolation with multi-valued property", "/temp", superProp.getString("path.current"));
}
public void testMultipleInterpolation() throws Exception
@@ -662,5 +666,4 @@
config.addPropertyDirect("array.double", new double[] { 1, 2 });
assertEquals("first element of the 'array.double' property", 1, config.getDouble("array.double"), 0);
}
-
}
Modified: jakarta/commons/proper/configuration/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/configuration/trunk/xdocs/changes.xml?rev=265545&r1=265544&r2=265545&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/xdocs/changes.xml (original)
+++ jakarta/commons/proper/configuration/trunk/xdocs/changes.xml Wed Aug 31 11:45:44 2005
@@ -23,6 +23,13 @@
<body>
<release version="1.2-dev" date="in SVN">
+ <action dev="oheger" type="update" issue="36447">
+ If a multi-valued property was involved in an interpolation operation,
+ AbstractConfiguration created a string representation of the list of all
+ values. This was changed to only use the first value, which makes more
+ sense in this context and is consistent with other getters for single
+ valued properties.
+ </action>
<action dev="oheger" type="add" issue="36383">
If an include file with a relative path cannot be found in the base
path, PropertiesConfiguration now also tries to resolve it based on its
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org