commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r755401 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
Date Tue, 17 Mar 2009 21:12:56 GMT
Author: markt
Date: Tue Mar 17 21:12:56 2009
New Revision: 755401

URL: http://svn.apache.org/viewvc?rev=755401&view=rev
Log:
Fix POOL-133.
Make sure active count is decremented even if destroyObject() throws an exception

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

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=755401&r1=755400&r2=755401&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
Tue Mar 17 21:12:56 2009
@@ -1018,11 +1018,12 @@
             } catch (Exception e) {
                 try {
                     _factory.destroyObject(key,pair.value);
+                } catch (Exception e2) {
+                    // swallowed
+                } finally {
                     synchronized (this) {
                         pool.decrementActiveCount();
                     }
-                } catch (Exception e2) {
-                    // swallowed
                 }
                 if(newlyCreated) {
                     throw new NoSuchElementException(
@@ -1046,11 +1047,12 @@
             if (invalid) {
                 try {
                     _factory.destroyObject(key,pair.value);
+                } catch (Exception e) {
+                    // swallowed
+                } finally {
                     synchronized (this) {
                         pool.decrementActiveCount();
                     }
-                } catch (Exception e) {
-                    // swallowed
                 }
                 if(newlyCreated) {
                     throw new NoSuchElementException("Could not create a validated object");



Mime
View raw message