From c5e256751603e7893a845f2c094bcc1d5461fc55 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 27 Nov 2014 10:57:27 +1100 Subject: [PATCH] [MRM-1871] copy List before sorting it --- .../archiva/proxy/DefaultRepositoryProxyConnectors.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 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; } -- 2.39.5