You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2013/12/20 11:06:57 UTC

svn commit: r1552579 - in /commons/proper/pool/trunk/src: changes/changes.xml main/java/org/apache/commons/pool2/PoolUtils.java

Author: markt
Date: Fri Dec 20 10:06:57 2013
New Revision: 1552579

URL: http://svn.apache.org/r1552579
Log:
Remove a duplicate null check and fix some typos in PoolUtils.
Based on a patch by Bruno P. Kinoshita.

Modified:
    commons/proper/pool/trunk/src/changes/changes.xml
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java

Modified: commons/proper/pool/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/changes/changes.xml?rev=1552579&r1=1552578&r2=1552579&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/changes/changes.xml (original)
+++ commons/proper/pool/trunk/src/changes/changes.xml Fri Dec 20 10:06:57 2013
@@ -67,6 +67,9 @@ The <action> type attribute can be add,u
       Include the number of times an object has been borrowed from the Pool when
       the DefaultPooledObject wrapper is used.
     </action>
+    <action issue="POOL-245" dev="markt" type="fix" due-to="Bruno P. Kinoshita">
+      Remove a duplicate null check and fix some typos in PoolUtils.
+    </action>
   </release>
   <release version="2.0" date="2013-11-11" description=
 "This is a major new release that provides significant performance improvements

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java?rev=1552579&r1=1552578&r2=1552579&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/PoolUtils.java Fri Dec 20 10:06:57 2013
@@ -347,9 +347,6 @@ public final class PoolUtils {
      */
     public static <K, V> KeyedObjectPool<K, V> synchronizedPool(
             final KeyedObjectPool<K, V> keyedPool) {
-        if (keyedPool == null) {
-            throw new IllegalArgumentException("keyedPool must not be null.");
-        }
         /*
          * assert !(keyedPool instanceof GenericKeyedObjectPool) :
          * "GenericKeyedObjectPool is already thread-safe"; assert !(keyedPool
@@ -394,17 +391,17 @@ public final class PoolUtils {
     }
 
     /**
-     * Returns a pool that adaptively decreases it's size when idle objects are
+     * Returns a pool that adaptively decreases its size when idle objects are
      * no longer needed. This is intended as an always thread-safe alternative
      * to using an idle object evictor provided by many pool implementations.
      * This is also an effective way to shrink FIFO ordered pools that
      * experience load spikes.
      *
      * @param pool
-     *            the ObjectPool to be decorated so it shrinks it's idle count
+     *            the ObjectPool to be decorated so it shrinks its idle count
      *            when possible.
      * @param <T> the type of objects in the pool
-     * @return a pool that adaptively decreases it's size when idle objects are
+     * @return a pool that adaptively decreases its size when idle objects are
      *         no longer needed.
      * @see #erodingPool(ObjectPool, float)
      */
@@ -413,28 +410,28 @@ public final class PoolUtils {
     }
 
     /**
-     * Returns a pool that adaptively decreases it's size when idle objects are
+     * Returns a pool that adaptively decreases its size when idle objects are
      * no longer needed. This is intended as an always thread-safe alternative
      * to using an idle object evictor provided by many pool implementations.
      * This is also an effective way to shrink FIFO ordered pools that
      * experience load spikes.
      * <p>
      * The factor parameter provides a mechanism to tweak the rate at which the
-     * pool tries to shrink it's size. Values between 0 and 1 cause the pool to
-     * try to shrink it's size more often. Values greater than 1 cause the pool
-     * to less frequently try to shrink it's size.
+     * pool tries to shrink its size. Values between 0 and 1 cause the pool to
+     * try to shrink its size more often. Values greater than 1 cause the pool
+     * to less frequently try to shrink its size.
      * </p>
      *
      * @param pool
-     *            the ObjectPool to be decorated so it shrinks it's idle count
+     *            the ObjectPool to be decorated so it shrinks its idle count
      *            when possible.
      * @param factor
      *            a positive value to scale the rate at which the pool tries to
-     *            reduce it's size. If 0 &lt; factor &lt; 1 then the pool
+     *            reduce its size. If 0 &lt; factor &lt; 1 then the pool
      *            shrinks more aggressively. If 1 &lt; factor then the pool
      *            shrinks less aggressively.
      * @param <T> the type of objects in the pool
-     * @return a pool that adaptively decreases it's size when idle objects are
+     * @return a pool that adaptively decreases its size when idle objects are
      *         no longer needed.
      * @see #erodingPool(ObjectPool)
      */
@@ -450,18 +447,18 @@ public final class PoolUtils {
     }
 
     /**
-     * Returns a pool that adaptively decreases it's size when idle objects are
+     * Returns a pool that adaptively decreases its size when idle objects are
      * no longer needed. This is intended as an always thread-safe alternative
      * to using an idle object evictor provided by many pool implementations.
      * This is also an effective way to shrink FIFO ordered pools that
      * experience load spikes.
      *
      * @param keyedPool
-     *            the KeyedObjectPool to be decorated so it shrinks it's idle
+     *            the KeyedObjectPool to be decorated so it shrinks its idle
      *            count when possible.
      * @param <K> the type of the pool key
      * @param <V> the type of pool entries
-     * @return a pool that adaptively decreases it's size when idle objects are
+     * @return a pool that adaptively decreases its size when idle objects are
      *         no longer needed.
      * @see #erodingPool(KeyedObjectPool, float)
      * @see #erodingPool(KeyedObjectPool, float, boolean)
@@ -472,29 +469,29 @@ public final class PoolUtils {
     }
 
     /**
-     * Returns a pool that adaptively decreases it's size when idle objects are
+     * Returns a pool that adaptively decreases its size when idle objects are
      * no longer needed. This is intended as an always thread-safe alternative
      * to using an idle object evictor provided by many pool implementations.
      * This is also an effective way to shrink FIFO ordered pools that
      * experience load spikes.
      * <p>
      * The factor parameter provides a mechanism to tweak the rate at which the
-     * pool tries to shrink it's size. Values between 0 and 1 cause the pool to
-     * try to shrink it's size more often. Values greater than 1 cause the pool
-     * to less frequently try to shrink it's size.
+     * pool tries to shrink its size. Values between 0 and 1 cause the pool to
+     * try to shrink its size more often. Values greater than 1 cause the pool
+     * to less frequently try to shrink its size.
      * </p>
      *
      * @param keyedPool
-     *            the KeyedObjectPool to be decorated so it shrinks it's idle
+     *            the KeyedObjectPool to be decorated so it shrinks its idle
      *            count when possible.
      * @param factor
      *            a positive value to scale the rate at which the pool tries to
-     *            reduce it's size. If 0 &lt; factor &lt; 1 then the pool
+     *            reduce its size. If 0 &lt; factor &lt; 1 then the pool
      *            shrinks more aggressively. If 1 &lt; factor then the pool
      *            shrinks less aggressively.
      * @param <K> the type of the pool key
      * @param <V> the type of pool entries
-     * @return a pool that adaptively decreases it's size when idle objects are
+     * @return a pool that adaptively decreases its size when idle objects are
      *         no longer needed.
      * @see #erodingPool(KeyedObjectPool, float, boolean)
      */
@@ -504,37 +501,37 @@ public final class PoolUtils {
     }
 
     /**
-     * Returns a pool that adaptively decreases it's size when idle objects are
+     * Returns a pool that adaptively decreases its size when idle objects are
      * no longer needed. This is intended as an always thread-safe alternative
      * to using an idle object evictor provided by many pool implementations.
      * This is also an effective way to shrink FIFO ordered pools that
      * experience load spikes.
      * <p>
      * The factor parameter provides a mechanism to tweak the rate at which the
-     * pool tries to shrink it's size. Values between 0 and 1 cause the pool to
-     * try to shrink it's size more often. Values greater than 1 cause the pool
-     * to less frequently try to shrink it's size.
+     * pool tries to shrink its size. Values between 0 and 1 cause the pool to
+     * try to shrink its size more often. Values greater than 1 cause the pool
+     * to less frequently try to shrink its size.
      * </p>
      * <p>
      * The perKey parameter determines if the pool shrinks on a whole pool basis
      * or a per key basis. When perKey is false, the keys do not have an effect
-     * on the rate at which the pool tries to shrink it's size. When perKey is
+     * on the rate at which the pool tries to shrink its size. When perKey is
      * true, each key is shrunk independently.
      * </p>
      *
      * @param keyedPool
-     *            the KeyedObjectPool to be decorated so it shrinks it's idle
+     *            the KeyedObjectPool to be decorated so it shrinks its idle
      *            count when possible.
      * @param factor
      *            a positive value to scale the rate at which the pool tries to
-     *            reduce it's size. If 0 &lt; factor &lt; 1 then the pool
+     *            reduce its size. If 0 &lt; factor &lt; 1 then the pool
      *            shrinks more aggressively. If 1 &lt; factor then the pool
      *            shrinks less aggressively.
      * @param perKey
      *            when true, each key is treated independently.
      * @param <K> the type of the pool key
      * @param <V> the type of pool entries
-     * @return a pool that adaptively decreases it's size when idle objects are
+     * @return a pool that adaptively decreases its size when idle objects are
      *         no longer needed.
      * @see #erodingPool(KeyedObjectPool)
      * @see #erodingPool(KeyedObjectPool, float)