cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] git commit: Try and detect MOXy so we can set the appropriate property for the default namespace. The RI will throw an exception if we set it all the time (unlike MOXy) so we can only set this if we're reasonbly sure we're going to have MOXy.
Date Fri, 28 Mar 2014 13:45:28 GMT
Try and detect MOXy so we can set the appropriate property for the default namespace.
The RI will throw an exception if we set it all the time (unlike MOXy) so we can only set
this if we're reasonbly sure we're going to have MOXy.


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

Branch: refs/heads/master
Commit: b023ff3f98d144b6042412be27876772d78de2b5
Parents: 8605382
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Mar 28 09:44:16 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Mar 28 09:44:16 2014 -0400

----------------------------------------------------------------------
 .../apache/cxf/common/jaxb/JAXBContextCache.java  | 18 +++++++++++++++++-
 .../java/org/apache/cxf/jaxb/JAXBDataBinding.java |  2 ++
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b023ff3f/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
index 9eac5a6..bb859f4 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
@@ -125,7 +125,20 @@ public final class JAXBContextCache {
         = new CacheMap<Set<Class<?>>, Map<String, CachedContextAndSchemasInternal>>();
 
     private static final Map<Package, CachedClass> OBJECT_FACTORY_CACHE
-        = new CacheMap<Package, CachedClass>(); 
+        = new CacheMap<Package, CachedClass>();
+    
+    private static final boolean HAS_MOXY;
+    
+    static {
+        boolean b = false;
+        try {
+            JAXBContext ctx = JAXBContext.newInstance(String.class);
+            b = ctx.getClass().getName().contains(".eclipse");
+        } catch (Throwable t) {
+            //ignore
+        }
+        HAS_MOXY = b;
+    }
     
     private JAXBContextCache() {
         //utility class
@@ -182,6 +195,9 @@ public final class JAXBContextCache {
 
         Map<String, Object> map = new HashMap<String, Object>();
         if (defaultNs != null) {
+            if (HAS_MOXY) {
+                map.put("eclipselink.default-target-namespace", defaultNs);
+            }
             map.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNs);
         }
         if (props != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/b023ff3f/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
index 067d8f0..cbca739 100644
--- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
+++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
@@ -381,6 +381,8 @@ public class JAXBDataBinding extends AbstractInterceptorProvidingDataBinding
                         continue;
                     }
                 }
+                //StaxUtils.print(r.getNode());
+                //System.out.println();
                 addSchemaDocument(serviceInfo,
                                   col,
                                  (Document)r.getNode(),


Mime
View raw message