From 54b22367001d20483c85358d7ca0c1eededbc647 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 24 Nov 2014 11:14:11 +1100 Subject: [PATCH] make it clear it is ConcurrentMap so no need of synchronized block --- .../DefaultRepositoryProxyConnectors.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java index 11eda06f3..686214938 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -97,6 +97,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; /** * DefaultRepositoryProxyConnectors @@ -134,9 +135,9 @@ public class DefaultRepositoryProxyConnectors @Inject private UrlFailureCache urlFailureCache; - private Map> proxyConnectorMap = new ConcurrentHashMap<>(); + private ConcurrentMap> proxyConnectorMap = new ConcurrentHashMap<>(); - private Map networkProxyMap = new ConcurrentHashMap<>(); + private ConcurrentMap networkProxyMap = new ConcurrentHashMap<>(); @Inject private WagonFactory wagonFactory; @@ -1253,17 +1254,16 @@ public class DefaultRepositoryProxyConnectors @Override public List getProxyConnectors( ManagedRepositoryContent repository ) { - synchronized ( this.proxyConnectorMap ) - { - List ret = this.proxyConnectorMap.get( repository.getId() ); - if ( ret == null ) - { - return Collections.emptyList(); - } - Collections.sort( ret, ProxyConnectorOrderComparator.getInstance() ); - return ret; + List ret = this.proxyConnectorMap.get( repository.getId() ); + if ( ret == null ) + { + return Collections.emptyList(); } + + Collections.sort( ret, ProxyConnectorOrderComparator.getInstance() ); + return ret; + } @Override -- 2.39.5