Skip to content

Commit adc8ece

Browse files
committed
Move comment
1 parent f690413 commit adc8ece

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,9 @@ public void clearOldest() {
642642
// build sorted map of idle objects
643643
final TreeMap<PooledObject<T>, K> map = new TreeMap<>();
644644

645-
poolMap.forEach((key, value) -> {
646-
// Each item into the map using the PooledObject object as the
647-
// key. It then gets sorted based on the idle time
648-
value.getIdleObjects().forEach(p -> map.put(p, key));
649-
});
645+
// Each item into the map using the PooledObject object as the
646+
// key. It then gets sorted based on the idle time
647+
poolMap.forEach((key, value) -> value.getIdleObjects().forEach(p -> map.put(p, key)));
650648

651649
// Now iterate created map and kill the first 15% plus one to account
652650
// for zero
@@ -655,9 +653,9 @@ public void clearOldest() {
655653

656654
while (iter.hasNext() && itemsToRemove > 0) {
657655
final Entry<PooledObject<T>, K> entry = iter.next();
658-
// kind of backwards on naming. In the map, each key is the
656+
// kind of backwards on naming. In the map, each key is the
659657
// PooledObject because it has the ordering with the timestamp
660-
// value. Each value that the key references is the key of the
658+
// value. Each value that the key references is the key of the
661659
// list it belongs to.
662660
final K key = entry.getValue();
663661
final PooledObject<T> p = entry.getKey();

0 commit comments

Comments
 (0)