cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: Update SwAOutInterceptor to work better with other JAXB impls
Date Tue, 23 Dec 2014 19:27:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b2db2a2b5 -> 46d5a13c2


Update SwAOutInterceptor to work better with other JAXB impls


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/46d5a13c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/46d5a13c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/46d5a13c

Branch: refs/heads/master
Commit: 46d5a13c2a8b76b84402fd9aabb85634e0b9bfa9
Parents: b2db2a2
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Dec 23 13:52:14 2014 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Dec 23 14:27:01 2014 -0500

----------------------------------------------------------------------
 .../cxf/jaxws/interceptors/SwAOutInterceptor.java    | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/46d5a13c/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
index c14539e..55e0a26 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
@@ -29,9 +29,11 @@ import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Logger;
@@ -74,6 +76,8 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor {
     
     private static final Map<String, Method> SWA_REF_METHOD 
         = new ConcurrentHashMap<String, Method>(4, 0.75f, 2);
+    private static final Set<String> SWA_REF_NO_METHOD 
+        = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(4, 0.75f,
2));
     
     AttachmentOutInterceptor attachOut = new AttachmentOutInterceptor();
     
@@ -84,8 +88,9 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor {
     }
     
     private boolean callSWARefMethod(final JAXBContext ctx) {
-        Method m = SWA_REF_METHOD.get(ctx.getClass().getName());
-        if (m == null && !SWA_REF_METHOD.containsKey(ctx.getClass().getName())) {
+        String cname = ctx.getClass().getName();
+        Method m = SWA_REF_METHOD.get(cname);
+        if (m == null && !SWA_REF_NO_METHOD.contains(cname)) {
             try {
                 m = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>()
{
 
@@ -97,7 +102,11 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor {
                         return hasSwaRefMethod;
                     }
                 });
-                SWA_REF_METHOD.put(ctx.getClass().getName(), m);
+                if (m == null) {
+                    SWA_REF_NO_METHOD.add(cname);
+                } else {
+                    SWA_REF_METHOD.put(cname, m);
+                }
             } catch (Exception e) {
                 //ignore
             }


Mime
View raw message