[MRM-1871] copy List before sorting it

This commit is contained in:
Olivier Lamy 2014-11-27 10:57:27 +11:00
parent 0148a725c7
commit c5e2567516
1 changed files with 3 additions and 3 deletions

View 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;
}