Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 42008 invoked from network); 5 Jan 2009 15:26:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jan 2009 15:26:02 -0000 Received: (qmail 26540 invoked by uid 500); 5 Jan 2009 15:26:02 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 26497 invoked by uid 500); 5 Jan 2009 15:26:02 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 26488 invoked by uid 99); 5 Jan 2009 15:26:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 07:26:02 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 15:26:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8B4BF2388988; Mon, 5 Jan 2009 07:25:41 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r731598 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java Date: Mon, 05 Jan 2009 15:25:41 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090105152541.8B4BF2388988@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Jan 5 07:25:40 2009 New Revision: 731598 URL: http://svn.apache.org/viewvc?rev=731598&view=rev Log: Proper fix for element traversal Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java?rev=731598&r1=731597&r2=731598&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java Mon Jan 5 07:25:40 2009 @@ -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; @@ -39,21 +38,15 @@ List ps = new ArrayList(); List prs = new ArrayList(); - NodeList children = e.getChildNodes(); - if (children != null) { - for (int i = 0; i < children.getLength(); i++) { - Node nd = children.item(i); - if (nd.getNodeType() == Node.ELEMENT_NODE) { - Element elem = (Element)nd; - if ("Policy".equals(elem.getLocalName())) { - ps.add(elem); - } else if ("PolicyReference".equals(elem.getLocalName())) { - prs.add(elem); - } - } + 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(elem); } - bean.addPropertyValue("policyElements", ps); bean.addPropertyValue("policyReferenceElements", prs);