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 de1838bb99c0c0314b3904354c1f6a8b616f2b80
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jul 16 12:44:00 2022 -0400

    Use forEach()
---
 .../org/apache/commons/configuration2/tree/ImmutableNode.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/configuration2/tree/ImmutableNode.java 
b/src/main/java/org/apache/commons/configuration2/tree/ImmutableNode.java
index a23c70f2..7a688bfe 100644
--- a/src/main/java/org/apache/commons/configuration2/tree/ImmutableNode.java
+++ b/src/main/java/org/apache/commons/configuration2/tree/ImmutableNode.java
@@ -104,11 +104,11 @@ public final class ImmutableNode implements 
Iterable<ImmutableNode> {
         if (name == null) {
             return list;
         }
-        for (final ImmutableNode node : children) {
+        children.forEach(node -> {
             if (name.equals(node.getNodeName())) {
                 list.add(node);
             }
-        }
+        });
         return list;
     }
 
@@ -555,11 +555,11 @@ public final class ImmutableNode implements 
Iterable<ImmutableNode> {
          */
         private static Collection<? extends ImmutableNode> filterNull(final 
Collection<? extends ImmutableNode> children) {
             final List<ImmutableNode> result = new 
ArrayList<>(children.size());
-            for (final ImmutableNode c : children) {
+            children.forEach(c -> {
                 if (c != null) {
                     result.add(c);
                 }
-            }
+            });
             return result;
         }
     }

Reply via email to