From: Olivier Lamy Date: Wed, 26 Nov 2014 23:57:27 +0000 (+1100) Subject: [MRM-1871] copy List before sorting it X-Git-Tag: archiva-2.2.0~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c5e256751603e7893a845f2c094bcc1d5461fc55;p=archiva.git [MRM-1871] copy List before sorting it --- 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 2095b6bd7..ad73be6a9 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 @@ -1255,14 +1255,14 @@ public class DefaultRepositoryProxyConnectors public List getProxyConnectors( ManagedRepositoryContent repository ) { - List ret = this.proxyConnectorMap.get( repository.getId() ); - if ( ret == null ) + if ( !this.proxyConnectorMap.containsKey( repository.getId() ) ) { return Collections.emptyList(); } + List ret = new ArrayList<>( this.proxyConnectorMap.get( repository.getId() ) ); Collections.sort( ret, ProxyConnectorOrderComparator.getInstance() ); - return new ArrayList<>( ret ); + return ret; }