[java-metadata-aggregator] branch master updated: MDA-84 - review uses of NodeList
Ian Young
ian at iay.org.uk
Tue Aug 15 12:08:19 EDT 2017
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch master
in repository java-metadata-aggregator.
View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=b2631959bc3fada6c2949c87845e2b5981e3f5db
The following commit(s) were added to refs/heads/master by this push:
new b263195 MDA-84 - review uses of NodeList
b263195 is described below
commit b2631959bc3fada6c2949c87845e2b5981e3f5db
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Tue Aug 15 17:07:14 2017 +0100
MDA-84 - review uses of NodeList
---
.../metadata/dom/AbstractNamespacesStrippingStage.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
index 91e6e91..867ed5e 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractNamespacesStrippingStage.java
@@ -29,8 +29,6 @@ import org.slf4j.LoggerFactory;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import net.shibboleth.metadata.ErrorStatus;
import net.shibboleth.metadata.Item;
@@ -38,6 +36,7 @@ import net.shibboleth.metadata.ItemMetadata;
import net.shibboleth.metadata.pipeline.AbstractIteratingStage;
import net.shibboleth.utilities.java.support.collection.ClassToInstanceMultiMap;
import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.xml.ElementSupport;
/**
* An abstract stage which removes all evidence of given XML namespaces from each metadata item.
@@ -156,12 +155,9 @@ public abstract class AbstractNamespacesStrippingStage extends AbstractIterating
/*
* Recursively process the DOM below this element.
*/
- final NodeList children = element.getChildNodes();
- for (int eIndex = 0; eIndex < children.getLength(); eIndex++) {
- final Node child = children.item(eIndex);
- if (child instanceof Element) {
- processElement((Element) child, depth+1);
- }
+ final List<Element> children = ElementSupport.getChildElements(element);
+ for (final Element child : children) {
+ processElement(child, depth+1);
}
/*
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list