Author: ron.sigal(a)jboss.com
Date: 2008-12-29 21:09:29 -0500 (Mon, 29 Dec 2008)
New Revision: 4770
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshalFactory.java
Log:
JBREM-1072: Made static maps synchronized collections.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshalFactory.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshalFactory.java 2008-12-29
21:43:30 UTC (rev 4769)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshalFactory.java 2008-12-30
02:09:29 UTC (rev 4770)
@@ -31,6 +31,7 @@
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -46,10 +47,10 @@
*/
public class MarshalFactory
{
- private static Map marshallers = new HashMap();
- private static Map unmarshallers = new HashMap();
- private static Map classMarshallers = new HashMap();
- private static Map classUnmarshallers = new HashMap();
+ private static Map marshallers = Collections.synchronizedMap(new HashMap());
+ private static Map unmarshallers = Collections.synchronizedMap(new HashMap());
+ private static Map classMarshallers = Collections.synchronizedMap(new HashMap());
+ private static Map classUnmarshallers = Collections.synchronizedMap(new HashMap());
protected final static Logger log = Logger.getLogger(MarshalFactory.class);
Show replies by date