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/16 18:04:33 UTC
svn commit: r695952 - in /cxf/branches/2.0.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: Tue Sep 16 09:04:31 2008
New Revision: 695952
URL: http://svn.apache.org/viewvc?rev=695952&view=rev
Log:
Merged revisions 695553 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes
................
r695553 | dkulp | 2008-09-15 13:15:27 -0400 (Mon, 15 Sep 2008) | 9 lines
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.0.x-fixes/ (props changed)
cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 16 09:04:31 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,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484
+/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,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537
/incubator/cxf/trunk:434594-651668
Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java?rev=695952&r1=695951&r2=695952&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java (original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java Tue Sep 16 09:04:31 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.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java?rev=695952&r1=695951&r2=695952&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java (original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java Tue Sep 16 09:04:31 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.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=695952&r1=695951&r2=695952&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Tue Sep 16 09:04:31 2008
@@ -48,7 +48,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.0.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.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?rev=695952&r1=695951&r2=695952&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java (original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java Tue Sep 16 09:04:31 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;
}