From: Olivier Lamy Date: Mon, 24 Nov 2014 00:14:11 +0000 (+1100) Subject: make it clear it is ConcurrentMap so no need of synchronized block X-Git-Tag: archiva-2.2.0~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=54b22367001d20483c85358d7ca0c1eededbc647;p=archiva.git make it clear it is ConcurrentMap so no need of synchronized block --- 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