You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2019/11/13 07:37:05 UTC

[GitHub] [cxf] amarkevich commented on a change in pull request #597: CXF-8149 Reduce synchronization in AbstractJXBProvider

amarkevich commented on a change in pull request #597: CXF-8149 Reduce synchronization in AbstractJXBProvider
URL: https://github.com/apache/cxf/pull/597#discussion_r345604869
 
 

 ##########
 File path: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
 ##########
 @@ -506,38 +505,41 @@ public JAXBContext getJAXBContext(Class<?> type, Type genericType) throws JAXBEx
             }
         }
 
-        synchronized (classContexts) {
-            JAXBContext context = classContexts.get(type);
-            if (context != null) {
-                return context;
-            }
+        JAXBContext context = classContexts.get(type);
+        if (context != null) {
+            return context;
         }
 
-        JAXBContext context = getPackageContext(type, genericType);
+        context = getPackageContext(type, genericType);
 
         return context != null ? context : getClassContext(type, genericType);
     }
     public JAXBContext getClassContext(Class<?> type) throws JAXBException {
         return getClassContext(type, type);
     }
     protected JAXBContext getClassContext(Class<?> type, Type genericType) throws JAXBException {
-        synchronized (classContexts) {
-            JAXBContext context = classContexts.get(type);
-            if (context == null) {
-                Class<?>[] classes;
-                if (extraClass != null) {
-                    classes = new Class[extraClass.length + 1];
-                    classes[0] = type;
-                    System.arraycopy(extraClass, 0, classes, 1, extraClass.length);
-                } else {
-                    classes = new Class[] {type};
-                }
+        final AtomicReference<JAXBException> jaxbException = new AtomicReference<>();
 
 Review comment:
   `JAXBException extends Exception` -> should be handled inside Function or catched+rethrown in the main code for the same behaviour

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services