commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1102622 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Date Fri, 13 May 2011 09:21:26 GMT
Author: markt
Date: Fri May 13 09:21:26 2011
New Revision: 1102622

URL: http://svn.apache.org/viewvc?rev=1102622&view=rev
Log:
Fix possible NPE if forced creation fails

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

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1102622&r1=1102621&r2=1102622&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Fri May 13 09:21:26 2011
@@ -1074,7 +1074,7 @@ public class GenericKeyedObjectPool<K,T>
                     create = true;
                     p = create(key, true);
                 }
-                if (!p.allocate()) {
+                if (p != null && !p.allocate()) {
                     p = null;
                 }
             }



Mime
View raw message