This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit 116bef716671b7808b780490cb0e04c4b19c133b
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Jun 27 17:57:35 2021 -0400

    Call swallowException(Exception) instead of printing exceptions to the
    console in GenericKeyedObjectPool.removeAbandoned(AbandonedConfig) and
    GenericObjectPool.removeAbandoned(AbandonedConfig).
---
 src/changes/changes.xml                                                | 3 +++
 .../java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java     | 3 +--
 src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java     | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 245ce37..369abc8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -79,6 +79,9 @@ The <action> type attribute can be add,update,fix,remove.
     <action dev="ggregory" type="fix" due-to="Gary Gregory">
       Make Duration setters use their respective default values when null.
     </action>
+    <action dev="ggregory" type="fix" due-to="Gary Gregory">
+      Call swallowException(Exception) instead of printing exceptions to the 
console in GenericKeyedObjectPool.removeAbandoned(AbandonedConfig) and 
GenericObjectPool.removeAbandoned(AbandonedConfig).
+    </action>
     <!--  UPDATES -->
     <action dev="ggregory" type="fix" due-to="Gary Gregory">
       Bump org.ow2.asm:asm-util from 9.1 to 9.2.
diff --git 
a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java 
b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
index 64274bd..d47d823 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -1584,8 +1584,7 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
                 try {
                     invalidateObject(pool.getKey(), pooledObject.getObject(), 
DestroyMode.ABANDONED);
                 } catch (final Exception e) {
-                    // TODO handle/log?
-                    e.printStackTrace();
+                    swallowException(e);
                 }
             }
         }
diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java 
b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
index c5fed24..369701d 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
@@ -1107,7 +1107,7 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
             try {
                 invalidateObject(pooledObject.getObject(), 
DestroyMode.ABANDONED);
             } catch (final Exception e) {
-                e.printStackTrace();
+                swallowException(e);
             }
         }
     }

Reply via email to