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 2023/07/14 18:38:27 UTC

[commons-pool] 04/04: Better use of Map API

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 12ed6beee868d29d5a95484fbd34f20efce3996e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jul 14 14:38:18 2023 -0400

    Better use of Map API
---
 src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 18b507e4..e00e60ac 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -614,7 +614,7 @@ public class GenericKeyedObjectPool<K, T, E extends Exception> extends BaseGener
      */
     public void clear(final K key, final boolean reuseCapacity) {
         // Return immediately if there is no pool under this key.
-        if (poolMap.get(key) == null) {
+        if (!poolMap.containsKey(key)) {
             return;
         }
         final ObjectDeque<T> objectDeque = register(key);