You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/06/16 10:10:44 UTC
(maven-resolver) 12/34: Fix DefaultAuthenticationSelector — use ConcurrentHashMap
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
commit 4f9e372021c8dcab1921bf4977ece6f2dcc98720
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sun Jun 7 06:41:28 2026 +0000
Fix DefaultAuthenticationSelector — use ConcurrentHashMap
F-15: Replace plain HashMap with ConcurrentHashMap to prevent data
corruption when add() and getAuthentication() are called from
different threads.
---
.../eclipse/aether/util/repository/DefaultAuthenticationSelector.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java
index 6df08df19..95ba503a6 100644
--- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java
+++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java
@@ -18,8 +18,8 @@
*/
package org.eclipse.aether.util.repository;
-import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.AuthenticationSelector;
@@ -32,7 +32,7 @@ import static java.util.Objects.requireNonNull;
*/
public final class DefaultAuthenticationSelector implements AuthenticationSelector {
- private final Map<String, Authentication> repos = new HashMap<>();
+ private final Map<String, Authentication> repos = new ConcurrentHashMap<>();
/**
* Adds the specified authentication info for the given repository identifier.