From d0b2a20903c26ae784f46a4b9f3b10f2049c8242 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Tue, 19 Jan 2010 15:49:53 +0000 Subject: [PATCH] [MRM-1025] avoid concurrent access exceptions git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@900825 13f79535-47bb-0310-9956-ffa450edef68 --- .../metadata/repository/file/FileMetadataRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index 1211c2c9d..a6ec061ba 100644 --- a/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -120,7 +120,7 @@ public class FileMetadataRepository Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY ); // remove properties that are not references or artifacts - for ( Object key : properties.keySet() ) + for ( Object key : new ArrayList( properties.keySet() ) ) { String name = (String) key; if ( !name.contains( ":" ) && !name.equals( "facetIds" ) ) @@ -296,7 +296,7 @@ public class FileMetadataRepository { metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name ); Map map = new HashMap(); - for ( Object key : properties.keySet() ) + for ( Object key : new ArrayList( properties.keySet() ) ) { String property = (String) key; map.put( property, properties.getProperty( property ) ); @@ -784,7 +784,7 @@ public class FileMetadataRepository { MetadataFacet facet = factory.createMetadataFacet(); Map map = new HashMap(); - for ( Object key : properties.keySet() ) + for ( Object key : new ArrayList( properties.keySet() ) ) { String property = (String) key; if ( property.startsWith( facet.getFacetId() ) ) -- 2.39.5