]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1871] copy List before sorting it
authorOlivier Lamy <olamy@apache.org>
Wed, 26 Nov 2014 23:57:27 +0000 (10:57 +1100)
committerOlivier Lamy <olamy@apache.org>
Wed, 26 Nov 2014 23:57:27 +0000 (10:57 +1100)
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java

index 2095b6bd7c6dec7da534c4d0b6657f8bd5ebb43c..ad73be6a90191e971ae3dd5746127d6f7a1fff65 100644 (file)
@@ -1255,14 +1255,14 @@ public class DefaultRepositoryProxyConnectors
     public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository )
     {
 
-        List<ProxyConnector> ret = this.proxyConnectorMap.get( repository.getId() );
-        if ( ret == null )
+        if ( !this.proxyConnectorMap.containsKey( repository.getId() ) )
         {
             return Collections.emptyList();
         }
+        List<ProxyConnector> ret = new ArrayList<>( this.proxyConnectorMap.get( repository.getId() ) );
 
         Collections.sort( ret, ProxyConnectorOrderComparator.getInstance() );
-        return new ArrayList<>( ret );
+        return ret;
 
     }