cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r730139 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/spring/PolicyFeatureBeanDefinitionParser.java
Date Tue, 30 Dec 2008 14:56:51 GMT
Author: sergeyb
Date: Tue Dec 30 06:56:51 2008
New Revision: 730139

URL: http://svn.apache.org/viewvc?rev=730139&view=rev
Log:
Avoiding DomUtils in PolicyFeatureBeanDefinitionParser to avoid recursive lock in OSGI env

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=730139&r1=730138&r2=730139&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
Tue Dec 30 06:56:51 2008
@@ -22,9 +22,10 @@
 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;
@@ -38,14 +39,19 @@
         List<Element> ps = new ArrayList<Element>();
         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);
+        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);
+                    }   
+                }
+            }
         }
         
         bean.addPropertyValue("policyElements", ps);



Mime
View raw message