From: Brett Porter Date: Tue, 19 Jan 2010 15:49:53 +0000 (+0000) Subject: [MRM-1025] avoid concurrent access exceptions X-Git-Tag: archiva-1.4-M1~1017^2~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d0b2a20903c26ae784f46a4b9f3b10f2049c8242;p=archiva.git [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 --- 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() ) )