copy collections to avoid ConcurrentModificationException

This commit is contained in:
Olivier Lamy 2014-11-23 23:02:06 +11:00
parent 5d29c9ff1d
commit 480825d72b
1 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ public class DefaultRepositoryProxyConnectors
@Inject
private UrlFailureCache urlFailureCache;
private Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<>();
private Map<String, List<ProxyConnector>> proxyConnectorMap = new ConcurrentHashMap<>();
private Map<String, ProxyInfo> networkProxyMap = new ConcurrentHashMap<>();
@ -457,7 +457,7 @@ public class DefaultRepositoryProxyConnectors
boolean metadataNeedsUpdating = false;
long originalTimestamp = getLastModified( localFile );
List<ProxyConnector> connectors = getProxyConnectors( repository );
List<ProxyConnector> connectors = new ArrayList<>( getProxyConnectors( repository ) );
for ( ProxyConnector connector : connectors )
{
if ( connector.isDisabled() )