cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [12/21] 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 Wed, 02 Apr 2014 06:26:08 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/02835711
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/02835711
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/02835711

Branch: refs/heads/2.7.x-fixes
Commit: 02835711e84b31a0e74f8d4a384937ad3be684ed
Parents: 0e45ee67
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Mar 28 09:44:16 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Apr 2 02:16:00 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/02835711/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java b/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
index 64c6e1f..b593388 100644
--- a/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
+++ b/api/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
@@ -180,6 +193,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/02835711/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 79272e4..95fed9b 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
@@ -395,6 +395,8 @@ public class JAXBDataBinding extends AbstractDataBinding
                         continue;
                     }
                 }
+                //StaxUtils.print(r.getNode());
+                //System.out.println();
                 addSchemaDocument(serviceInfo,
                                   col,
                                  (Document)r.getNode(),


Mime
View raw message