You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/05/15 17:36:34 UTC

svn commit: r1482909 - in /commons/proper/pool/branches/POOL_1_X/src: changes/changes.xml java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java

Author: ggregory
Date: Wed May 15 15:36:34 2013
New Revision: 1482909

URL: http://svn.apache.org/r1482909
Log:
[POOL-234] SoftReferenceObjectPool swallows underlying exceptions when activating / validating newly created object.

Modified:
    commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml
    commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java

Modified: commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml?rev=1482909&r1=1482908&r2=1482909&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml (original)
+++ commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml Wed May 15 15:36:34 2013
@@ -22,6 +22,9 @@
   </properties>
   <body>
   <release version="1.6.1" date="?" description="">
+    <action dev="ggregory" type="fix" issue="POOL-234" due-to="izapolsky@gmail.com">
+      SoftReferenceObjectPool swallows underlying exceptions when activating / validating newly created object.
+    </action>
     <action dev="ggregory" type="fix" issue="POOL-227" due-to="liviutudor">
       Unit test failures due to getMinIdle changes.
     </action>

Modified: commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java?rev=1482909&r1=1482908&r2=1482909&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java (original)
+++ commons/proper/pool/branches/POOL_1_X/src/java/org/apache/commons/pool/impl/SoftReferenceObjectPool.java Wed May 15 15:36:34 2013
@@ -143,9 +143,11 @@ public class SoftReferenceObjectPool<T> 
                         obj = null;
                     }
                     if (newlyCreated) {
-                        throw new NoSuchElementException(
+                        final NoSuchElementException e = new NoSuchElementException(
                             "Could not create a validated object, cause: " +
                             t.getMessage());
+                        e.initCause(t);
+                        throw e;
                     }
                 }
             }