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/15 19:15:28 UTC
svn commit: r695553 - in /cxf/branches/2.1.x-fixes: ./
common/common/src/main/java/org/apache/cxf/helpers/
rt/core/src/main/java/org/apache/cxf/transport/http/
rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/
Author: dkulp
Date: Mon Sep 15 10:15:27 2008
New Revision: 695553
URL: http://svn.apache.org/viewvc?rev=695553&view=rev
Log:
Merged revisions 695537 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r695537 | seanoc | 2008-09-15 12:31:53 -0400 (Mon, 15 Sep 2008) | 1 line
Removed further references to NodeList
........
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
cxf/branches/2.1.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 15 10:15:27 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,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484
+/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,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537
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/helpers/DOMUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java?rev=695553&r1=695552&r2=695553&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java (original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java Mon Sep 15 10:15:27 2008
@@ -462,7 +462,8 @@
String localName,
List<Element> elementList) {
- if (localName.equals(el.getLocalName()) && nameSpaceURI.contains(el.getNamespaceURI())) {
+ if (localName.equals(el.getLocalName())
+ && nameSpaceURI.contains(el.getNamespaceURI())) {
elementList.add(el);
}
Element elem = getFirstElement(el);
@@ -471,4 +472,25 @@
elem = getNextElement(elem);
}
}
+
+
+
+
+ public static List<Element> findAllElementsByTagName(Element elem, String tagName) {
+ List<Element> ret = new LinkedList<Element>();
+ findAllElementsByTagName(elem, tagName, ret);
+ return ret;
+ }
+
+ public static void findAllElementsByTagName(Element el, String tagName, List<Element> elementList) {
+
+ if (tagName.equals(el.getTagName())) {
+ elementList.add(el);
+ }
+ Element elem = getFirstElement(el);
+ while (elem != null) {
+ findAllElementsByTagName(elem, tagName, elementList);
+ elem = getNextElement(elem);
+ }
+ }
}
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=695553&r1=695552&r2=695553&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 Mon Sep 15 10:15:27 2008
@@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.io.Writer;
import java.util.Collections;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
@@ -54,7 +55,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.ls.DOMImplementationLS;
@@ -355,17 +355,14 @@
}
public static Element fetchElementByNameAttribute(Element parent, String targetName, String nameValue) {
- Element ret = null;
- NodeList nodeList = parent.getElementsByTagName(targetName);
- Node node = null;
- for (int i = 0; i < nodeList.getLength(); i++) {
- node = nodeList.item(i);
- if (node instanceof Element && ((Element)node).getAttribute("name").equals(nameValue)) {
- ret = (Element)node;
- break;
+
+ List<Element> elemList = DOMUtils.findAllElementsByTagName(parent, targetName);
+ for (Element elem : elemList) {
+ if (elem.getAttribute("name").equals(nameValue)) {
+ return elem;
}
}
- return ret;
+ return null;
}
public static QName getQName(String value, Node node) {
Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=695553&r1=695552&r2=695553&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Mon Sep 15 10:15:27 2008
@@ -45,7 +45,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-//import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
Modified: cxf/branches/2.1.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?rev=695553&r1=695552&r2=695553&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java (original)
+++ cxf/branches/2.1.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java Mon Sep 15 10:15:27 2008
@@ -22,12 +22,9 @@
import java.util.Map;
import java.util.TreeMap;
-
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
@@ -37,6 +34,7 @@
import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
import org.apache.cxf.configuration.spring.BusWiringType;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
import org.apache.cxf.transport.http_jetty.ThreadingParameters;
@@ -101,17 +99,14 @@
private List getRequiredElementsList(Element parent, ParserContext ctx, QName name,
BeanDefinitionBuilder bean) {
- NodeList nl = parent.getChildNodes();
- ManagedList list = new ManagedList(nl.getLength());
+ List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(parent,
+ name.getNamespaceURI(),
+ name.getLocalPart());
+ ManagedList list = new ManagedList(elemList.size());
list.setSource(ctx.extractSource(parent));
- 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())) {
- list.add(ctx.getDelegate().
- parsePropertySubElement((Element)n, bean.getBeanDefinition()));
-
- }
+
+ for (Element elem : elemList) {
+ list.add(ctx.getDelegate().parsePropertySubElement(elem, bean.getBeanDefinition()));
}
return list;
}