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 7a127008ebbd070ccd4da0eeb74a91f3ce92d743 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jul 16 12:59:21 2022 -0400 Use forEach() --- .../apache/commons/configuration2/tree/OverrideCombiner.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java b/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java index a71d82af..b1c1abe0 100644 --- a/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java +++ b/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java @@ -53,22 +53,22 @@ public class OverrideCombiner extends NodeCombiner { result.name(node1.getNodeName()); // Process nodes from the first structure, which override the second - for (final ImmutableNode child : node1) { + node1.forEach(child -> { final ImmutableNode child2 = canCombine(node1, node2, child); if (child2 != null) { result.addChild(combine(child, child2)); } else { result.addChild(child); } - } + }); // Process nodes from the second structure, which are not contained // in the first structure - for (final ImmutableNode child : node2) { + node2.forEach(child -> { if (HANDLER.getChildrenCount(node1, child.getNodeName()) < 1) { result.addChild(child); } - } + }); // Handle attributes and value addAttributes(result, node1, node2); @@ -87,11 +87,11 @@ public class OverrideCombiner extends NodeCombiner { */ protected void addAttributes(final ImmutableNode.Builder result, final ImmutableNode node1, final ImmutableNode node2) { result.addAttributes(node1.getAttributes()); - for (final String attr : node2.getAttributes().keySet()) { + node2.getAttributes().keySet().forEach(attr -> { if (!node1.getAttributes().containsKey(attr)) { result.addAttribute(attr, HANDLER.getAttributeValue(node2, attr)); } - } + }); } /**