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 2024/09/03 12:20:00 UTC

(commons-pool) 01/02: Move comment

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 471b74e75f32fa63708da9c588e0cb4b5dbd60e0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Sep 3 08:03:43 2024 -0400

    Move comment
---
 .../apache/commons/pool3/impl/GenericKeyedObjectPool.java    | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/pool3/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool3/impl/GenericKeyedObjectPool.java
index 766953ad..f556af06 100644
--- a/src/main/java/org/apache/commons/pool3/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool3/impl/GenericKeyedObjectPool.java
@@ -647,11 +647,9 @@ public class GenericKeyedObjectPool<K, T, E extends Exception> extends BaseGener
         // build sorted map of idle objects
         final TreeMap<PooledObject<T>, K> map = new TreeMap<>();
 
-        poolMap.forEach((key, value) -> {
-            // Each item into the map using the PooledObject object as the
-            // key. It then gets sorted based on the idle time
-            value.getIdleObjects().forEach(p -> map.put(p, key));
-        });
+        // Each item into the map using the PooledObject object as the
+        // key. It then gets sorted based on the idle time
+        poolMap.forEach((key, value) -> value.getIdleObjects().forEach(p -> map.put(p, key)));
 
         // Now iterate created map and kill the first 15% plus one to account
         // for zero
@@ -660,9 +658,9 @@ public class GenericKeyedObjectPool<K, T, E extends Exception> extends BaseGener
 
         while (iter.hasNext() && itemsToRemove > 0) {
             final Entry<PooledObject<T>, K> entry = iter.next();
-            // kind of backwards on naming.  In the map, each key is the
+            // kind of backwards on naming. In the map, each key is the
             // PooledObject because it has the ordering with the timestamp
-            // value.  Each value that the key references is the key of the
+            // value. Each value that the key references is the key of the
             // list it belongs to.
             final K key = entry.getValue();
             final PooledObject<T> p = entry.getKey();