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-dbcp.git


The following commit(s) were added to refs/heads/master by this push:
     new f029306  Use == with enum.
f029306 is described below

commit f0293062ac465e48ee38801456827dfe656f1a9a
Author: Gary Gregory <gardgreg...@gmail.com>
AuthorDate: Sat Jun 5 09:35:23 2021 -0400

    Use == with enum.
---
 .../java/org/apache/commons/dbcp2/PoolableConnectionFactory.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java 
b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
index 276b98d..ee0930f 100644
--- a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
@@ -145,7 +145,7 @@ public class PoolableConnectionFactory implements 
PooledObjectFactory<PoolableCo
      */
     @Override
     public void destroyObject(final PooledObject<PoolableConnection> p, final 
DestroyMode mode) throws Exception {
-        if (mode != null && mode.equals(DestroyMode.ABANDONED)) {
+        if (mode == DestroyMode.ABANDONED) {
             p.getObject().getInnermostDelegate().abort(Runnable::run);
         } else {
             p.getObject().reallyClose();
@@ -153,6 +153,8 @@ public class PoolableConnectionFactory implements 
PooledObjectFactory<PoolableCo
     }
 
     /**
+     * Gets the cache state.
+     *
      * @return The cache state.
      * @since Made public in 2.6.0.
      */
@@ -161,6 +163,8 @@ public class PoolableConnectionFactory implements 
PooledObjectFactory<PoolableCo
     }
 
     /**
+     * Gets the connection factory.
+     *
      * @return The connection factory.
      * @since Made public in 2.6.0.
      */

Reply via email to