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

commit 00146c490e4f1acc220cb01912503b879da5798f
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jul 16 13:41:30 2022 -0400

    Use forEach()
---
 .../org/apache/commons/configuration2/BaseConfiguration.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java 
b/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
index 47040410..919c7f0e 100644
--- a/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
+++ b/src/main/java/org/apache/commons/configuration2/BaseConfiguration.java
@@ -168,13 +168,13 @@ public class BaseConfiguration extends 
AbstractConfiguration implements Cloneabl
         copy.store = clonedStore;
 
         // Handle collections in the map; they have to be cloned, too
-        for (final Map.Entry<String, Object> e : store.entrySet()) {
-            if (e.getValue() instanceof Collection) {
+        store.forEach((k, v) -> {
+            if (v instanceof Collection) {
                 // This is safe because the collections were created by 
ourselves
                 @SuppressWarnings("unchecked")
-                final Collection<String> strList = (Collection<String>) 
e.getValue();
-                copy.store.put(e.getKey(), new ArrayList<>(strList));
+                final Collection<String> strList = (Collection<String>) v;
+                copy.store.put(k, new ArrayList<>(strList));
             }
-        }
+        });
     }
 }

Reply via email to