cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1044305 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Date Fri, 10 Dec 2010 11:40:30 GMT
Author: ningjiang
Date: Fri Dec 10 11:40:30 2010
New Revision: 1044305

URL: http://svn.apache.org/viewvc?rev=1044305&view=rev
Log:
CXF-3180 removed the synchronized part of JAXBMarshallerUnmarshallerCache as it is used per
thread

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1044305&r1=1044304&r2=1044305&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Fri Dec 10 11:40:30 2010
@@ -714,30 +714,28 @@ public abstract class AbstractJAXBProvid
             if (jaxbContext == null) {
                 return null;
             }
-            synchronized (marshallers) {
-                Marshaller marshaller = marshallers.get(jaxbContext);
-                if (marshaller == null) {
-                    marshaller = jaxbContext.createMarshaller();
-                    marshallers.put(jaxbContext, marshaller);
-                }
-                return marshaller;
+            // don't need the synchronized statement, as this ojbect is used per thread
+            Marshaller marshaller = marshallers.get(jaxbContext);
+            if (marshaller == null) {
+                marshaller = jaxbContext.createMarshaller();
+                marshallers.put(jaxbContext, marshaller);
             }
-            
+            return marshaller;
+
         }
-        
+
         public Unmarshaller getUnmarshall(JAXBContext jaxbContext) throws JAXBException {
             if (jaxbContext == null) {
                 return null;
             }
-            synchronized (unmarshallers) {
-                Unmarshaller unmarshaller = unmarshallers.get(jaxbContext);
-                if (unmarshaller == null) {
-                    unmarshaller = jaxbContext.createUnmarshaller();
-                    unmarshallers.put(jaxbContext, unmarshaller);
-                }
-                return unmarshaller;
+            // don't need the synchronized statement, as this ojbect is used per thread
+            Unmarshaller unmarshaller = unmarshallers.get(jaxbContext);
+            if (unmarshaller == null) {
+                unmarshaller = jaxbContext.createUnmarshaller();
+                unmarshallers.put(jaxbContext, unmarshaller);
             }
-            
+            return unmarshaller;
+
         }
         
     }



Mime
View raw message