This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git


The following commit(s) were added to refs/heads/master by this push:
     new daff1261 Copy in copy method; otherwise reuse (#750)
daff1261 is described below

commit daff12619a5be961a5dad8c191a47edc4ec353c4
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Thu Jun 12 23:31:32 2025 +0200

    Copy in copy method; otherwise reuse (#750)
---
 .../src/main/java/org/eclipse/aether/util/graph/manager/MMap.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/MMap.java
 
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/MMap.java
index 8981a74d..af7aa34c 100644
--- 
a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/MMap.java
+++ 
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/MMap.java
@@ -44,13 +44,13 @@ public class MMap<K, V> {
     }
 
     public static <K, V> MMap<K, V> copy(MMap<K, V> orig) {
-        return new MMap<>(orig.delegate);
+        return new MMap<>(new HashMap<>(orig.delegate));
     }
 
     protected final HashMap<K, V> delegate;
 
     private MMap(HashMap<K, V> delegate) {
-        this.delegate = new HashMap<>(delegate);
+        this.delegate = delegate;
     }
 
     public boolean containsKey(K key) {

Reply via email to