tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1236153 - /tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java
Date Thu, 26 Jan 2012 12:05:41 GMT
Author: antelder
Date: Thu Jan 26 12:05:41 2012
New Revision: 1236153

URL: http://svn.apache.org/viewvc?rev=1236153&view=rev
Log:
Update the JMS Axiom XML helper to create more correct wrapper elements

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java?rev=1236153&r1=1236152&r2=1236153&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java
Thu Jan 26 12:05:41 2012
@@ -67,21 +67,20 @@ public class AXIOMXMLHelper implements X
 
     @Override
     public Object wrap(OMElement template, OMElement os) {
-        OMElement newWrapper = template.cloneOMElement();
+        OMElement wrapper;
         if (os != null) {
-            os.declareDefaultNamespace(newWrapper.getNamespace().getNamespaceURI());
-            newWrapper.addChild(os);
+            OMNamespace ns = os.declareNamespace(template.getNamespace().getNamespaceURI(),
"");
+            wrapper = factory.createOMElement(template.getLocalName(), ns);
+            wrapper.addChild(os);
+        } else {
+            wrapper = template.cloneOMElement();
         }
-        return newWrapper;
+        return wrapper;
     }
 
     @Override
     public OMElement createWrapper(QName qname) {
-        // The OMElement2JAXB transformer wants the opName to be capitalized
-        String opName = Character.toUpperCase(qname.getLocalPart().charAt(0)) + (qname.getLocalPart().length()
> 1 ? qname.getLocalPart().substring(1) : "");
-        OMElement om = factory.createOMElement(qname);
-        OMNamespace defaultNS = om.declareDefaultNamespace(qname.getNamespaceURI());
-        return factory.createOMElement(opName, defaultNS);
+        return factory.createOMElement(qname);
     }
 
     @Override



Mime
View raw message