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 2016/03/16 21:20:11 UTC

svn commit: r1735292 - /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Author: markt
Date: Wed Mar 16 20:20:11 2016
New Revision: 1735292

URL: http://svn.apache.org/viewvc?rev=1735292&view=rev
Log:
Correct location of decrement

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1735292&r1=1735291&r2=1735292&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java Wed Mar 16 20:20:11 2016
@@ -1030,7 +1030,6 @@ public class GenericKeyedObjectPool<K,T>
                 if (newCreateCount > maxTotalPerKeySave) {
                     // The key is currently at capacity or in the process of
                     // making enough new objects to take it to capacity.
-                    numTotal.decrementAndGet();
                     objectDeque.getCreateCount().decrementAndGet();
                     if (objectDeque.makeObjectCount == 0) {
                         // There are no makeObject() calls in progress for this
@@ -1054,6 +1053,7 @@ public class GenericKeyedObjectPool<K,T>
         }
 
         if (!create.booleanValue()) {
+            numTotal.decrementAndGet();
             return null;
         }