Author: dkulp Date: Fri May 22 13:08:25 2009 New Revision: 777505 URL: http://svn.apache.org/viewvc?rev=777505&view=rev Log: WeakHashMaps aren't thread safe, wrap it with sync map.
Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=777505&r1=777504&r2=777505&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Fri May 22 13:08:25 2009 @@ -22,6 +22,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -86,9 +87,11 @@ protected PhaseChainCache inboundChainCache = new PhaseChainCache(); protected Map<String, Object> currentRequestContext = new ConcurrentHashMap<String, Object>(); - protected Map<Thread, EchoContext> requestContext = new WeakHashMap<Thread, EchoContext>(); + protected Map<Thread, EchoContext> requestContext + = Collections.synchronizedMap(new WeakHashMap<Thread, EchoContext>()); - protected Map<Thread, Map<String, Object>> responseContext = new WeakHashMap<Thread, Map<String, Object>>(); + protected Map<Thread, Map<String, Object>> responseContext + = Collections.synchronizedMap(new WeakHashMap<Thread, Map<String, Object>>()); protected Executor executor;