You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/12/13 23:18:48 UTC

svn commit: r1213962 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: GenericKeyedObjectPoolFactory.java GenericObjectPoolFactory.java

Author: sebb
Date: Tue Dec 13 22:18:47 2011
New Revision: 1213962

URL: http://svn.apache.org/viewvc?rev=1213962&view=rev
Log:
Forgot to clone the config in the getter methods

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java?rev=1213962&r1=1213961&r2=1213962&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolFactory.java Tue Dec 13 22:18:47 2011
@@ -62,10 +62,10 @@ public class GenericKeyedObjectPoolFacto
      * Obtain the configuration currently used by the factory allowing the
      * current settings to be viewed and changed.
      *  
-     * @return  The config object currently used by the factory
+     * @return  a copy of the config object currently used by the factory
      */
     public GenericKeyedObjectPoolConfig<K, T> getConfig() {
-        return config;
+        return config.clone(); // does not make sense to clone in the ctor but not here
     }
 
     /**

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java?rev=1213962&r1=1213961&r2=1213962&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java Tue Dec 13 22:18:47 2011
@@ -61,10 +61,10 @@ public class GenericObjectPoolFactory<T>
      * Obtain the configuration currently used by the factory allowing the
      * current settings to be viewed and changed.
      *  
-     * @return  The config object currently used by the factory
+     * @return  a copy of the config object currently used by the factory
      */
     public GenericObjectPoolConfig<T> getConfig() {
-        return config;
+        return config.clone(); // does not make sense to clone in the ctor but not here
     }