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 15:37:47 UTC
svn commit: r695877 - in /cxf/branches/2.1.x-fixes: ./
rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java
Author: dkulp
Date: Tue Sep 16 06:37:47 2008
New Revision: 695877
URL: http://svn.apache.org/viewvc?rev=695877&view=rev
Log:
Merged revisions 695835 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r695835 | seanoc | 2008-09-16 08:44:21 -0400 (Tue, 16 Sep 2008) | 1 line
Removed further references to NodeList
........
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java
cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 16 06:37:47 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,695537,695552,695561,695619,695684
+/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,695552,695561,695619,695684,695835
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.1.x-fixes/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java?rev=695877&r1=695876&r2=695877&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java (original)
+++ cxf/branches/2.1.x-fixes/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomNode.java Tue Sep 16 06:37:47 2008
@@ -24,7 +24,6 @@
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
@@ -176,6 +175,26 @@
private void establishChildren() {
if (!childrenWrapped) {
if (wrappedNode.hasChildNodes()) {
+ children = new JsSimpleDomNode[wrappedNode.getChildNodes().getLength()];
+ Node node = wrappedNode.getFirstChild();
+ int x = 0;
+ while (node != null) {
+ JsSimpleDomNode prev = null;
+ if (x > 0) {
+ prev = (JsSimpleDomNode)children[x - 1];
+ }
+ children[x] = newObject(node, prev);
+ if (x > 0) {
+ children[x - 1].setNext(children[x]);
+ }
+ node = node.getNextSibling();
+ x++;
+ }
+
+ /*
+
+
+
NodeList nodeChildren = wrappedNode.getChildNodes();
children = new JsSimpleDomNode[nodeChildren.getLength()];
for (int x = 0; x < nodeChildren.getLength(); x++) {
@@ -188,6 +207,7 @@
children[x - 1].setNext(children[x]);
}
}
+ */
} else {
children = new JsSimpleDomNode[0];
}
Modified: cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java?rev=695877&r1=695876&r2=695877&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java (original)
+++ cxf/branches/2.1.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java Tue Sep 16 06:37:47 2008
@@ -22,10 +22,9 @@
import java.util.List;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.ws.policy.WSPolicyFeature;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
@@ -37,19 +36,18 @@
@Override
protected void parseChildElements(Element e, ParserContext ctx, BeanDefinitionBuilder bean) {
List<Element> ps = new ArrayList<Element>();
- List<Element> prs = new ArrayList<Element>();
- NodeList children = e.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 ("Policy".equals(n.getLocalName())) {
- ps.add((Element)n);
- } else if ("PolicyReference".equals(name)) {
- prs.add((Element)n);
- }
- }
+ List<Element> prs = new ArrayList<Element>();
+
+ Element elem = DOMUtils.getFirstElement(e);
+ while (elem != null) {
+ if ("Policy".equals(elem.getLocalName())) {
+ ps.add(elem);
+ } else if ("PolicyReference".equals(elem.getLocalName())) {
+ prs.add(elem);
+ }
+ elem = DOMUtils.getNextElement(e);
}
+
bean.addPropertyValue("policyElements", ps);
bean.addPropertyValue("policyReferenceElements", prs);