cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1005556 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Date Thu, 07 Oct 2010 18:15:21 GMT
Author: dkulp
Date: Thu Oct  7 18:15:20 2010
New Revision: 1005556

URL: http://svn.apache.org/viewvc?rev=1005556&view=rev
Log:
Accound for the older woodstox sometimes return null instead of ""

Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=1005556&r1=1005555&r2=1005556&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Thu Oct  7 18:15:20 2010
@@ -835,7 +835,11 @@ public final class JAXBEncoderDecoder {
                 Enumeration enm = (Enumeration)c2.getClass().getMethod("getAllPrefixes").invoke(c2);
                 while (enm.hasMoreElements()) {
                     String s = (String)enm.nextElement();
-                    nsMap.put(s, c.getNamespaceURI(s));
+                    if (s == null) {
+                        nsMap.put("", c.getNamespaceURI(s));
+                    } else {
+                        nsMap.put(s, c.getNamespaceURI(s));
+                    }
                 }
             } catch (Throwable t2) {
                 //ignore
@@ -844,7 +848,11 @@ public final class JAXBEncoderDecoder {
         if (!nsMap.isEmpty()) {
             for (int x = 0; x < source.getNamespaceCount(); x++) {
                 String pfx = source.getNamespacePrefix(x);
-                nsMap.remove(pfx);
+                if (pfx == null) { 
+                    nsMap.remove("");
+                } else {
+                    nsMap.remove(pfx);
+                }
             }
             if (!nsMap.isEmpty()) {
                 @SuppressWarnings("unchecked")



Mime
View raw message