cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r691719 - in /cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/
Date Wed, 03 Sep 2008 18:37:02 GMT
Author: dkulp
Date: Wed Sep  3 11:37:02 2008
New Revision: 691719

URL: http://svn.apache.org/viewvc?rev=691719&view=rev
Log:
Merged revisions 691316 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes

................
  r691316 | dkulp | 2008-09-02 12:46:21 -0400 (Tue, 02 Sep 2008) | 9 lines
  
  Merged revisions 691271 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r691271 | dkulp | 2008-09-02 11:10:46 -0400 (Tue, 02 Sep 2008) | 2 lines
    
    element.setAttributeNS(...) is very slow with Xerces.  Don't use it on critical path.
  ........
................

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
    cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep  3 11:37:02 2008
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271
 /incubator/cxf/trunk:434594-651668

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep  3 11:37:02 2008
@@ -1 +1 @@
-/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464-687465,689109,689112,689122
+/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464-687465,689109,689112,689122,691316

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=691719&r1=691718&r2=691719&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Wed Sep  3 11:37:02 2008
@@ -745,13 +745,15 @@
     }
 
     private static void declare(Element node, String uri, String prefix) {
+        String qualname;
         if (prefix != null && prefix.length() > 0) {
-            node.setAttributeNS(XML_NS, "xmlns:" + prefix, uri);
+            qualname = "xmlns:" + prefix;
         } else {
-            if (uri != null /* && uri.length() > 0 */) {
-                node.setAttributeNS(XML_NS, "xmlns", uri);
-            }
+            qualname = "xmlns";
         }
+        Attr attr = node.getOwnerDocument().createAttributeNS(XML_NS, qualname);
+        attr.setValue(uri);
+        node.setAttributeNodeNS(attr);
     }
 
     /**

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java?rev=691719&r1=691718&r2=691719&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamWriter.java
Wed Sep  3 11:37:02 2008
@@ -150,12 +150,16 @@
         if (prefix.length() == 0) {
             writeDefaultNamespace(namespace);
         } else {
-            currentNode.setAttributeNS(XML_NS, "xmlns:" + prefix, namespace);
+            Attr attr = document.createAttributeNS(XML_NS, "xmlns:" + prefix);
+            attr.setValue(namespace);
+            currentNode.setAttributeNodeNS(attr);
         }
     }
 
     public void writeDefaultNamespace(String namespace) throws XMLStreamException {
-        currentNode.setAttributeNS(XML_NS, "xmlns", namespace);
+        Attr attr = document.createAttributeNS(XML_NS, "xmlns");
+        attr.setValue(namespace);
+        currentNode.setAttributeNodeNS(attr);
     }
 
     public void writeComment(String value) throws XMLStreamException {

Modified: cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?rev=691719&r1=691718&r2=691719&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
Wed Sep  3 11:37:02 2008
@@ -327,9 +327,10 @@
             //attributes cannot be in empty namespace...
             if (lastAdded.lookupNamespaceURI(JAXWSAConstants.WSA_PREFIX) == null) {
                 pfx = JAXWSAConstants.WSA_PREFIX;
-                lastAdded.setAttributeNS("http://www.w3.org/2000/xmlns/",
-                                         "xmlns:wsa",
-                                         namespaceURI);
+                Attr attr = lastAdded.getOwnerDocument()
+                    .createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:wsa");
+                attr.setValue(namespaceURI);
+                lastAdded.setAttributeNodeNS(attr);
             } else if (lastAdded.lookupNamespaceURI(JAXWSAConstants.WSA_PREFIX).equals(namespaceURI))
{
                 pfx = JAXWSAConstants.WSA_PREFIX;
             } else {
@@ -338,9 +339,10 @@
                     cnt++;
                 }
                 pfx = JAXWSAConstants.WSA_PREFIX + cnt;
-                lastAdded.setAttributeNS("http://www.w3.org/2000/xmlns/",
-                                         "xmlns:wsa" + cnt,
-                                         namespaceURI);
+                Attr attr = lastAdded.getOwnerDocument()
+                    .createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:wsa" + cnt);
+                attr.setValue(namespaceURI);
+                lastAdded.setAttributeNodeNS(attr);
             }
         }
         Attr isRefParamAttr = 

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?rev=691719&r1=691718&r2=691719&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
Wed Sep  3 11:37:02 2008
@@ -37,6 +37,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPException;
 
+import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -182,9 +183,12 @@
                     version.getHeader().getLocalPart());
             // add WSRM namespace declaration to header, instead of
             // repeating in each individual child node
-            hdr.setAttributeNS("http://www.w3.org/2000/xmlns/",
-                                  "xmlns:" + RMConstants.getNamespacePrefix(),
-                                 RMConstants.getNamespace());
+            
+            Attr attr = doc.createAttributeNS("http://www.w3.org/2000/xmlns/", 
+                                   "xmlns:" + RMConstants.getNamespacePrefix());
+            attr.setValue(RMConstants.getNamespace());
+            hdr.setAttributeNodeNS(attr);
+
             Marshaller marshaller = getJAXBContext().createMarshaller();
             marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
            
@@ -262,9 +266,11 @@
                            marshaller);
             Node node = hdr.getFirstChild();
             if (node instanceof Element) {
-                ((Element)node).setAttributeNS("http://www.w3.org/2000/xmlns/",
-                        "xmlns:" + RMConstants.getNamespacePrefix(),
-                       RMConstants.getNamespace());
+                
+                Attr attr = doc.createAttributeNS("http://www.w3.org/2000/xmlns/", 
+                                                  "xmlns:" + RMConstants.getNamespacePrefix());
+                attr.setValue(RMConstants.getNamespace());
+                ((Element)node).setAttributeNodeNS(attr);
             }
             
             header.add(new Header(new QName(node.getNamespaceURI(), node.getLocalName()),
node));



Mime
View raw message