From deba382d421307b98402703b050a5864b4e29137 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 1 Dec 2010 09:48:32 +0000 Subject: [PATCH] [MRM-1436] better Map handling Submitted by: Dave Brosius git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1040919 13f79535-47bb-0310-9956-ffa450edef68 --- .../configuration/DefaultArchivaConfiguration.java | 3 +-- .../archiva/indexer/search/NexusRepositorySearch.java | 10 +++++----- .../archiva/metadata/generic/GenericMetadataFacet.java | 5 +---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java index 1f22b1027..6821b2f95 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java @@ -315,9 +315,8 @@ public class DefaultArchivaConfiguration Map> proxyConnectorMap = config .getProxyConnectorAsMap(); - for ( String key : proxyConnectorMap.keySet() ) + for ( List connectors : proxyConnectorMap.values() ) { - List connectors = proxyConnectorMap.get( key ); // Sort connectors by order field. Collections.sort( connectors, ProxyConnectorConfigurationOrderComparator.getInstance() ); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java index 9ea86474c..53416912f 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java @@ -166,17 +166,17 @@ public class NexusRepositorySearch finally { Map indexingContexts = indexer.getIndexingContexts(); - Set keys = indexingContexts.keySet(); - for( String key : keys ) + + for ( Map.Entry entry : indexingContexts.entrySet() ) { try { - indexer.removeIndexingContext( indexingContexts.get( key ), false ); - log.debug( "Indexing context '" + key + "' removed from search." ); + indexer.removeIndexingContext( entry.getValue(), false ); + log.debug( "Indexing context '" + entry.getKey() + "' removed from search." ); } catch ( IOException e ) { - log.warn( "IOException occurred while removing indexing content '" + key + "'." ); + log.warn( "IOException occurred while removing indexing content '" + entry.getKey() + "'." ); continue; } } diff --git a/archiva-modules/plugins/generic-metadata-support/src/main/java/org/apache/archiva/metadata/generic/GenericMetadataFacet.java b/archiva-modules/plugins/generic-metadata-support/src/main/java/org/apache/archiva/metadata/generic/GenericMetadataFacet.java index 3044e4123..4dd887085 100644 --- a/archiva-modules/plugins/generic-metadata-support/src/main/java/org/apache/archiva/metadata/generic/GenericMetadataFacet.java +++ b/archiva-modules/plugins/generic-metadata-support/src/main/java/org/apache/archiva/metadata/generic/GenericMetadataFacet.java @@ -48,10 +48,7 @@ public class GenericMetadataFacet additionalProperties = new TreeMap(); } - for ( String key : properties.keySet() ) - { - additionalProperties.put( key, properties.get( key ) ); - } + additionalProperties.putAll( properties ); } public Map toProperties() -- 2.39.5