camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1326995 - /camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
Date Tue, 17 Apr 2012 08:40:58 GMT
Author: davsclaus
Date: Tue Apr 17 08:40:58 2012
New Revision: 1326995

URL: http://svn.apache.org/viewvc?rev=1326995&view=rev
Log:
Use concurrent list in case lazy loading type converters is enabled and doing concurrent testing
which may cause a concurrent modification exception while traversing fallback type converters

Modified:
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1326995&r1=1326994&r2=1326995&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
Tue Apr 17 08:40:58 2012
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
 
 import org.apache.camel.CamelExecutionException;
@@ -55,7 +56,7 @@ public abstract class BaseTypeConverterR
     protected final ConcurrentHashMap<TypeMapping, TypeConverter> typeMappings = new
ConcurrentHashMap<TypeMapping, TypeConverter>();
     protected final Map<TypeMapping, TypeMapping> misses = new ConcurrentHashMap<TypeMapping,
TypeMapping>();
     protected final List<TypeConverterLoader> typeConverterLoaders = new ArrayList<TypeConverterLoader>();
-    protected final List<FallbackTypeConverter> fallbackConverters = new ArrayList<FallbackTypeConverter>();
+    protected final List<FallbackTypeConverter> fallbackConverters = new CopyOnWriteArrayList<FallbackTypeConverter>();
     protected final PackageScanClassResolver resolver;
     protected Injector injector;
     protected final FactoryFinder factoryFinder;



Mime
View raw message