commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1467448 - in /commons/proper/configuration/trunk/src: main/java/org/apache/commons/configuration/CompositeConfiguration.java test/java/org/apache/commons/configuration/TestCompositeConfiguration.java
Date Fri, 12 Apr 2013 20:26:06 GMT
Author: oheger
Date: Fri Apr 12 20:26:05 2013
New Revision: 1467448

URL: http://svn.apache.org/r1467448
Log:
[CONFIGURATION-524] CompositeConfiguration.clone() now ensures that the
configuration's interpolator is cloned, too.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/CompositeConfiguration.java
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestCompositeConfiguration.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/CompositeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/CompositeConfiguration.java?rev=1467448&r1=1467447&r2=1467448&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/CompositeConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/CompositeConfiguration.java
Fri Apr 12 20:26:05 2013
@@ -441,6 +441,7 @@ implements Cloneable
                 }
             }
 
+            copy.cloneInterpolator(this);
             return copy;
         }
         catch (CloneNotSupportedException cnex)

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestCompositeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestCompositeConfiguration.java?rev=1467448&r1=1467447&r2=1467448&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestCompositeConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestCompositeConfiguration.java
Fri Apr 12 20:26:05 2013
@@ -559,6 +559,17 @@ public class TestCompositeConfiguration
     }
 
     /**
+     * Tests whether interpolation works as expected after cloning.
+     */
+    @Test
+    public void testCloneInterpolation()
+    {
+        CompositeConfiguration cc2 = (CompositeConfiguration) cc.clone();
+        assertNotSame("Interpolator was not cloned", cc.getInterpolator(),
+                cc2.getInterpolator());
+    }
+
+    /**
      * Tests whether add property events are triggered.
      */
     @Test



Mime
View raw message