cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: Update SwAOutInterceptor to work better with other JAXB impls
Date Fri, 09 Jan 2015 17:28:15 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 2b44ae9a6 -> 09346fdf8


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/53049ab8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/53049ab8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/53049ab8

Branch: refs/heads/3.0.x-fixes
Commit: 53049ab8937f29999034c91aabee111b6f0c3939
Parents: 2b44ae9
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Dec 23 13:52:14 2014 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jan 9 12:28:05 2015 -0500

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/53049ab8/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