You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/20 23:09:22 UTC

[commons-configuration] branch master updated: Initialize Map on instantiation.

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


The following commit(s) were added to refs/heads/master by this push:
     new a723678  Initialize Map on instantiation.
a723678 is described below

commit a723678e82c46cfed968c3ff546864523e0f3720
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 18:09:17 2020 -0500

    Initialize Map on instantiation.
---
 .../java/org/apache/commons/configuration2/tree/MergeCombiner.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java b/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
index 77aff05..f7e7b5b 100644
--- a/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
+++ b/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
@@ -95,8 +95,7 @@ public class MergeCombiner extends NodeCombiner
     protected void addAttributes(final ImmutableNode.Builder result, final ImmutableNode node1,
             final ImmutableNode node2)
     {
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.putAll(node1.getAttributes());
+        final Map<String, Object> attributes = new HashMap<>(node1.getAttributes());
         for (final Map.Entry<String, Object> e : node2.getAttributes().entrySet())
         {
             if (!attributes.containsKey(e.getKey()))