All better now :-) On Thu, Sep 2, 2021, 08:56 Gary Gregory <[email protected]> wrote:
> It looks like the build failed: > https://github.com/apache/commons-pool/actions/runs/1194029517 > > Gary > > On Thu, Sep 2, 2021, 07:46 <[email protected]> wrote: > >> This is an automated email from the ASF dual-hosted git repository. >> >> markt pushed a commit to branch master >> in repository https://gitbox.apache.org/repos/asf/commons-pool.git >> >> >> The following commit(s) were added to refs/heads/master by this push: >> new 50fb382 Use enhanced for loops rather than iterators >> 50fb382 is described below >> >> commit 50fb3823750e52efcbb223374daca32daa0e9bdf >> Author: Mark Thomas <[email protected]> >> AuthorDate: Thu Sep 2 12:46:15 2021 +0100 >> >> Use enhanced for loops rather than iterators >> --- >> src/main/java/org/apache/commons/pool2/KeyedObjectPool.java | 6 ++---- >> src/main/java/org/apache/commons/pool2/PoolUtils.java | 5 +---- >> 2 files changed, 3 insertions(+), 8 deletions(-) >> >> diff --git a/src/main/java/org/apache/commons/pool2/KeyedObjectPool.java >> b/src/main/java/org/apache/commons/pool2/KeyedObjectPool.java >> index 4b930bd..3996bfb 100644 >> --- a/src/main/java/org/apache/commons/pool2/KeyedObjectPool.java >> +++ b/src/main/java/org/apache/commons/pool2/KeyedObjectPool.java >> @@ -18,7 +18,6 @@ package org.apache.commons.pool2; >> >> import java.io.Closeable; >> import java.util.Collection; >> -import java.util.Iterator; >> import java.util.NoSuchElementException; >> >> /** >> @@ -108,9 +107,8 @@ public interface KeyedObjectPool<K, V> extends >> Closeable { >> if (keys == null) { >> throw new IllegalArgumentException(PoolUtils.MSG_NULL_KEYS); >> } >> - final Iterator<K> iter = keys.iterator(); >> - while (iter.hasNext()) { >> - addObjects(iter.next(), count); >> + for (final K key : keys) { >> + addObjects(key, count); >> } >> } >> >> diff --git a/src/main/java/org/apache/commons/pool2/PoolUtils.java >> b/src/main/java/org/apache/commons/pool2/PoolUtils.java >> index 7b1f4d5..ffbd89c 100644 >> --- a/src/main/java/org/apache/commons/pool2/PoolUtils.java >> +++ b/src/main/java/org/apache/commons/pool2/PoolUtils.java >> @@ -19,7 +19,6 @@ package org.apache.commons.pool2; >> import java.util.Collection; >> import java.util.Collections; >> import java.util.HashMap; >> -import java.util.Iterator; >> import java.util.Map; >> import java.util.NoSuchElementException; >> import java.util.Timer; >> @@ -1351,9 +1350,7 @@ public final class PoolUtils { >> throw new IllegalArgumentException(MSG_NULL_KEYS); >> } >> final Map<K, TimerTask> tasks = new HashMap<>(keys.size()); >> - final Iterator<K> iter = keys.iterator(); >> - while (iter.hasNext()) { >> - final K key = iter.next(); >> + for (final K key : keys) { >> final TimerTask task = checkMinIdle(keyedPool, key, minIdle, >> periodMillis); >> tasks.put(key, task); >> } >> >
