You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/09/11 22:43:52 UTC
svn commit: r694467 - in /cxf/branches/2.1.x-fixes: ./
common/common/src/main/java/org/apache/cxf/configuration/spring/
common/common/src/main/java/org/apache/cxf/helpers/
common/common/src/main/java/org/apache/cxf/staxutils/
integration/jbi/src/main/j...
Author: dkulp
Date: Thu Sep 11 13:43:50 2008
New Revision: 694467
URL: http://svn.apache.org/viewvc?rev=694467&view=rev
Log:
Merged revisions 693819 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r693819 | seanoc | 2008-09-10 08:44:01 -0400 (Wed, 10 Sep 2008) | 1 line
Modified code to remove use of NodeList
........
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
cxf/branches/2.1.x-fixes/integration/jbi/src/main/java/org/apache/cxf/jbi/se/CXFServiceUnit.java
cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultInInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/IriDecoderHelper.java
cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/SchemaWriterImpl.java
cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/WSDLCorbaWriterImpl.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 11 13:43:50 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java Thu Sep 11 13:43:50 2008
@@ -34,7 +34,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.CacheMap;
@@ -110,14 +109,11 @@
}
protected void parseChildElements(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node n = children.item(i);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- String name = n.getLocalName();
-
- mapElement(ctx, bean, (Element) n, name);
- }
+ Element el = DOMUtils.getFirstElement(element);
+ while (el != null) {
+ String name = el.getLocalName();
+ mapElement(ctx, bean, el, name);
+ el = DOMUtils.getNextElement(el);
}
}
@@ -209,15 +205,7 @@
}
protected Element getFirstChild(Element element) {
- Element first = null;
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node n = children.item(i);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- first = (Element) n;
- }
- }
- return first;
+ return DOMUtils.getFirstElement(element);
}
protected void addBusWiringAttribute(BeanDefinitionBuilder bean, BusWiringType type) {
@@ -238,14 +226,15 @@
String propertyName,
Class<?> c) {
Element data = null;
- NodeList nl = parent.getChildNodes();
- for (int i = 0; i < nl.getLength(); i++) {
- Node n = nl.item(i);
- if (n.getNodeType() == Node.ELEMENT_NODE && name.getLocalPart().equals(n.getLocalName())
- && name.getNamespaceURI().equals(n.getNamespaceURI())) {
- data = (Element)n;
+
+ Node node = parent.getFirstChild();
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE && name.getLocalPart().equals(node.getLocalName())
+ && name.getNamespaceURI().equals(node.getNamespaceURI())) {
+ data = (Element)node;
break;
}
+ node = node.getNextSibling();
}
if (data == null) {
Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java Thu Sep 11 13:43:50 2008
@@ -23,7 +23,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
@@ -66,14 +65,13 @@
addBusWiringAttribute(factoryBean, BusWiringType.PROPERTY);
}
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node n = children.item(i);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- String name = n.getLocalName();
-
- mapElement(ctx, factoryBean, (Element) n, name);
+ Node node = element.getFirstChild();
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ String name = node.getLocalName();
+ mapElement(ctx, factoryBean, (Element) node, name);
}
+ node = node.getNextSibling();
}
String id = getIdOrName(element);
Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java Thu Sep 11 13:43:50 2008
@@ -316,11 +316,11 @@
return createTextNode(node.getOwnerDocument(), data);
}
- public static void removeContents(Node node) {
- NodeList list = node.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node entry = list.item(i);
- node.removeChild(entry);
+ public static void removeContents(Node parent) {
+ Node node = parent.getFirstChild();
+ while (node != null) {
+ parent.removeChild(node);
+ node = node.getNextSibling();
}
}
Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Thu Sep 11 13:43:50 2008
@@ -57,7 +57,6 @@
import org.w3c.dom.EntityReference;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
@@ -443,16 +442,15 @@
if (writeProlog) {
writer.writeStartDocument();
}
-
- NodeList rootChildren = d.getChildNodes();
- for (int rcx = 0; rcx < rootChildren.getLength(); rcx++) {
- Node rootChild = rootChildren.item(rcx);
- // don't write PIs if we're not writing a prolog.
- if (writeProlog || rootChild.getNodeType() == Node.ELEMENT_NODE) {
- writeNode(rootChild, writer, repairing);
+
+ Node node = d.getFirstChild();
+ while (node != null) {
+ if (writeProlog || node.getNodeType() == Node.ELEMENT_NODE) {
+ writeNode(node, writer, repairing);
}
+ node = node.getNextSibling();
}
-
+
if (writeProlog) {
writer.writeEndDocument();
}
Modified: cxf/branches/2.1.x-fixes/integration/jbi/src/main/java/org/apache/cxf/jbi/se/CXFServiceUnit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/integration/jbi/src/main/java/org/apache/cxf/jbi/se/CXFServiceUnit.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/integration/jbi/src/main/java/org/apache/cxf/jbi/se/CXFServiceUnit.java (original)
+++ cxf/branches/2.1.x-fixes/integration/jbi/src/main/java/org/apache/cxf/jbi/se/CXFServiceUnit.java Thu Sep 11 13:43:50 2008
@@ -39,8 +39,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
@@ -280,14 +278,15 @@
return root;
}
- NodeList children = root.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- Node found = findNode(child, name);
- if (found != null) {
+ Node node = root.getFirstChild();
+
+ while (node != null) {
+ Node found = findNode(node, name);
+ if (found != null) {
return found;
- }
- }
+ }
+ node = node.getNextSibling();
+ }
return null;
}
Modified: cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultInInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultInInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultInInterceptor.java Thu Sep 11 13:43:50 2008
@@ -30,7 +30,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.binding.corba.CorbaBindingException;
import org.apache.cxf.binding.corba.CorbaMessage;
@@ -142,13 +141,11 @@
faultDoc.createElementNS(partInfoName.getNamespaceURI(), partInfoName.getLocalPart());
Element faultDataElement = (Element) faultData.getFirstChild();
-
- NodeList nodeList = faultDataElement.getChildNodes();
-
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node importedFaultData = faultDoc.
- importNode(nodeList.item(i), true);
+ Node node = faultDataElement.getFirstChild();
+ while (node != null) {
+ Node importedFaultData = faultDoc.importNode(node, true);
partElement.appendChild(importedFaultData);
+ node = node.getNextSibling();
}
faultElement.appendChild(partElement);
faultEx.setDetail(faultElement);
Modified: cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java Thu Sep 11 13:43:50 2008
@@ -34,7 +34,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.binding.corba.CorbaBindingException;
import org.apache.cxf.binding.corba.CorbaDestination;
@@ -294,13 +293,14 @@
Document faultDoc = DOMUtils.createDocument();
Element faultElement = faultDoc.createElement(exType.getException().getLocalPart());
faultDoc.appendChild(faultElement);
-
- NodeList nodeList = faultDetail.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node importedFaultData = faultDoc.importNode(nodeList.item(i), true);
+ Node node = faultDetail.getFirstChild();
+ while (node != null) {
+ Node importedFaultData = faultDoc.importNode(node, true);
faultElement.appendChild(importedFaultData);
+ node = node.getNextSibling();
}
+
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Exception DOM: " + XMLUtils.toString(faultElement));
}
Modified: cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/IriDecoderHelper.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/IriDecoderHelper.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/IriDecoderHelper.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/IriDecoderHelper.java Thu Sep 11 13:43:50 2008
@@ -32,7 +32,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.i18n.Message;
@@ -332,10 +331,10 @@
root.appendChild(ec);
}
} else {
- NodeList childNodes = ec.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node n = childNodes.item(j);
- ec.removeChild(n);
+ Node node = ec.getFirstChild();
+ while (node != null) {
+ ec.removeChild(node);
+ node = node.getNextSibling();
}
}
@@ -348,29 +347,26 @@
}
private static Element getIndexedElement(Element e, int i) {
- NodeList childNodes = e.getChildNodes();
+ Element elem = DOMUtils.getFirstElement(e);
int elNum = 0;
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node n = childNodes.item(j);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- if (i == elNum) {
- return (Element) n;
- }
- elNum++;
+ while (elem != null) {
+ if (i == elNum) {
+ return elem;
}
+ elNum++;
+ elem = DOMUtils.getNextElement(elem);
}
return null;
}
private static Element getElement(Element element, QName name) {
- NodeList childNodes = element.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node n = childNodes.item(j);
- if (n.getNodeType() == Node.ELEMENT_NODE
- && n.getLocalName().equals(name.getLocalPart())
- && n.getNamespaceURI().equals(name.getNamespaceURI())) {
- return (Element)n;
+ Element elem = DOMUtils.getFirstElement(element);
+ while (elem != null) {
+ if (elem.getLocalName().equals(name.getLocalPart())
+ && elem.getNamespaceURI().equals(name.getNamespaceURI())) {
+ return elem;
}
+ elem = DOMUtils.getNextElement(elem);
}
return null;
}
Modified: cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java Thu Sep 11 13:43:50 2008
@@ -21,7 +21,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.binding.http.URIMapper;
import org.apache.cxf.endpoint.Endpoint;
@@ -89,15 +88,14 @@
int locEnd = locPath.indexOf('}', idx1);
String name = locPath.substring(idx1 + 1, locEnd);
idx1 = locEnd;
-
- NodeList childNodes = root.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node n = childNodes.item(i);
-
- if (n.getNodeType() == Node.ELEMENT_NODE && name.equals(n.getLocalName())) {
- builder.append(DOMUtils.getContent(n));
+
+ Node node = root.getFirstChild();
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE && name.equals(node.getLocalName())) {
+ builder.append(DOMUtils.getContent(node));
break;
- }
+ }
+ node = node.getNextSibling();
}
start = locEnd + 1;
Modified: cxf/branches/2.1.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java Thu Sep 11 13:43:50 2008
@@ -24,13 +24,13 @@
import javax.xml.stream.XMLStreamWriter;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
import org.apache.cxf.binding.jbi.JBIConstants;
import org.apache.cxf.binding.jbi.JBIFault;
import org.apache.cxf.binding.jbi.JBIMessage;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.helpers.NSStack;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -64,13 +64,10 @@
writer.writeEmptyElement("fault");
} else {
Element detail = jbiFault.getDetail();
- NodeList details = detail.getChildNodes();
- for (int i = 0; i < details.getLength(); i++) {
- if (details.item(i) instanceof Element) {
- StaxUtils.writeNode(details.item(i), writer, true);
- break;
- }
- }
+ Element elem = DOMUtils.getFirstElement(detail);
+ if (elem != null) {
+ StaxUtils.writeNode(elem, writer, true);
+ }
}
writer.writeEndElement();
writer.flush();
Modified: cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java Thu Sep 11 13:43:50 2008
@@ -29,7 +29,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
import org.apache.cxf.binding.soap.Soap11;
import org.apache.cxf.binding.soap.SoapFault;
@@ -118,10 +118,11 @@
if (fault.hasDetails()) {
Element detail = fault.getDetail();
writer.writeStartElement("detail");
-
- NodeList details = detail.getChildNodes();
- for (int i = 0; i < details.getLength(); i++) {
- StaxUtils.writeNode(details.item(i), writer, true);
+
+ Node node = detail.getFirstChild();
+ while (node != null) {
+ StaxUtils.writeNode(node, writer, true);
+ node = node.getNextSibling();
}
// Details
Modified: cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java Thu Sep 11 13:43:50 2008
@@ -26,7 +26,7 @@
import javax.xml.stream.XMLStreamWriter;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
import org.apache.cxf.binding.soap.SoapFault;
import org.apache.cxf.binding.soap.SoapMessage;
@@ -95,9 +95,10 @@
Element detail = fault.getDetail();
writer.writeStartElement(defaultPrefix, "Detail", ns);
- NodeList details = detail.getChildNodes();
- for (int i = 0; i < details.getLength(); i++) {
- StaxUtils.writeNode(details.item(i), writer, true);
+ Node node = detail.getFirstChild();
+ while (node != null) {
+ StaxUtils.writeNode(node, writer, true);
+ node = node.getNextSibling();
}
// Details
Modified: cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java (original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java Thu Sep 11 13:43:50 2008
@@ -34,8 +34,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@@ -43,6 +41,7 @@
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.service.ServiceModelVisitor;
import org.apache.cxf.service.model.MessagePartInfo;
@@ -127,20 +126,17 @@
schemaMap.put(file, null);
Document doc = XMLUtils.parse(ins);
-
- NodeList nodes = doc.getDocumentElement().getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node n = nodes.item(i);
- if (n instanceof Element) {
- Element e = (Element)n;
- if (e.getLocalName().equals("import")) {
- String loc = e.getAttribute("schemaLocation");
- if (!StringUtils.isEmpty(loc)) {
- getSchema(sts, loc);
- }
+ Element elem = DOMUtils.getFirstElement(doc.getDocumentElement());
+ while (elem != null) {
+ if (elem.getLocalName().equals("import")) {
+ String loc = elem.getAttribute("schemaLocation");
+ if (!StringUtils.isEmpty(loc)) {
+ getSchema(sts, loc);
}
- }
- }
+ }
+ elem = DOMUtils.getNextElement(elem);
+ }
+
XmlSchema schema = dataBinding.addSchemaDocument(serviceInfo,
schemas,
doc,
Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java (original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Thu Sep 11 13:43:50 2008
@@ -26,8 +26,6 @@
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
@@ -36,6 +34,7 @@
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
import org.apache.cxf.configuration.spring.BusWiringType;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
@@ -97,29 +96,27 @@
}
}
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node n = children.item(i);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- String name = n.getLocalName();
- if ("properties".equals(name)) {
- Map map = ctx.getDelegate().parseMapElement((Element) n, bean.getBeanDefinition());
- bean.addPropertyValue("properties", map);
- } else if ("binding".equals(name)) {
- setFirstChildAsProperty((Element) n, ctx, bean, "bindingConfig");
- } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
- || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
- || "features".equals(name) || "schemaLocations".equals(name)
- || "handlers".equals(name)) {
- List list = ctx.getDelegate().parseListElement((Element) n, bean.getBeanDefinition());
- bean.addPropertyValue(name, list);
- } else if (IMPLEMENTOR.equals(name)) {
- ctx.getDelegate()
- .parseConstructorArgElement((Element)n, bean.getBeanDefinition());
- } else {
- setFirstChildAsProperty((Element) n, ctx, bean, name);
- }
+ Element elem = DOMUtils.getFirstElement(element);
+ while (elem != null) {
+ String name = elem.getLocalName();
+ if ("properties".equals(name)) {
+ Map map = ctx.getDelegate().parseMapElement(elem, bean.getBeanDefinition());
+ bean.addPropertyValue("properties", map);
+ } else if ("binding".equals(name)) {
+ setFirstChildAsProperty(elem, ctx, bean, "bindingConfig");
+ } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)
+ || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)
+ || "features".equals(name) || "schemaLocations".equals(name)
+ || "handlers".equals(name)) {
+ List list = ctx.getDelegate().parseListElement(elem, bean.getBeanDefinition());
+ bean.addPropertyValue(name, list);
+ } else if (IMPLEMENTOR.equals(name)) {
+ ctx.getDelegate()
+ .parseConstructorArgElement(elem, bean.getBeanDefinition());
+ } else {
+ setFirstChildAsProperty(elem, ctx, bean, name);
}
+ elem = DOMUtils.getNextElement(elem);
}
if (!isAbstract) {
bean.setInitMethodName("publish");
Modified: cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Thu Sep 11 13:43:50 2008
@@ -304,7 +304,9 @@
}
protected void buildServiceFromWSDL(String url) {
- LOG.info("Creating Service " + getServiceQName() + " from WSDL: " + url);
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("Creating Service " + getServiceQName() + " from WSDL: " + url);
+ }
populateFromClass = false;
WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url, getServiceQName());
setService(factory.create());
@@ -323,7 +325,9 @@
}
protected void buildServiceFromClass() {
- LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
+ }
populateFromClass = true;
if (Proxy.isProxyClass(this.getServiceClass())) {
Modified: cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java (original)
+++ cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java Thu Sep 11 13:43:50 2008
@@ -279,14 +279,15 @@
public String getAnnotation() {
String result = null;
Element element = doc.getDocumentElement();
- NodeList list = element.getChildNodes();
-
- for (int i = 0; i < list.getLength(); i++) {
- if ((list.item(i).getNodeType() == Node.ELEMENT_NODE)
- && ("annotation".equals(list.item(i).getNodeName()))) {
- result = list.item(i).getFirstChild().getNodeValue();
+
+ Node node = element.getFirstChild();
+ while (node != null) {
+ if ((node.getNodeType() == Node.ELEMENT_NODE)
+ && ("annotation".equals(node.getNodeName()))) {
+ result = node.getNodeValue();
break;
}
+ node = node.getNextSibling();
}
return result;
}
Modified: cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/SchemaWriterImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/SchemaWriterImpl.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/SchemaWriterImpl.java (original)
+++ cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/SchemaWriterImpl.java Thu Sep 11 13:43:50 2008
@@ -35,7 +35,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import com.ibm.wsdl.Constants;
import com.ibm.wsdl.util.xml.DOM2Writer;
@@ -128,15 +127,16 @@
}
pw.print(">");
- NodeList list = element.getChildNodes();
+ Node node = element.getFirstChild();
pw.println();
- for (int i = 0; i < list.getLength(); i++) {
- Node node = list.item(i);
+ while (node != null) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
printDOMElement((Element) node, pw, indentCount + 2);
pw.println();
}
+ node = node.getNextSibling();
}
+
indent(pw, indentCount);
if (element.getLocalName().equals("schema")) {
pw.print("</xs:" + element.getLocalName() + ">");
Modified: cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/WSDLCorbaWriterImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/WSDLCorbaWriterImpl.java?rev=694467&r1=694466&r2=694467&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/WSDLCorbaWriterImpl.java (original)
+++ cxf/branches/2.1.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/WSDLCorbaWriterImpl.java Thu Sep 11 13:43:50 2008
@@ -37,7 +37,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import com.ibm.wsdl.Constants;
import com.ibm.wsdl.util.xml.DOM2Writer;
@@ -173,14 +172,14 @@
pw.print(" " + attr.getName() + "=\"" + attr.getValue() + "\"");
}
pw.print(">");
- NodeList list = element.getChildNodes();
+ Node node = element.getFirstChild();
pw.println();
- for (int i = 0; i < list.getLength(); i++) {
- Node node = list.item(i);
+ while (node != null) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
printDOMElement((Element) node, pw, indentCount + 2);
pw.println();
}
+ node = node.getNextSibling();
}
indent(pw, indentCount);
pw.print("</" + element.getNodeName() + ">");