You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by ra...@apache.org on 2005/04/02 21:17:56 UTC
cvs commit: xml-security/src/org/apache/xml/security/transforms/implementations TransformXPathFilterCHGP.java
raul 2005/04/02 11:17:56
Modified: src/org/apache/xml/security/transforms/implementations
TransformXPathFilterCHGP.java
Log:
Reuse the convert nodelist to set in Xmlutils
Revision Changes Path
1.16 +3 -24 xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPathFilterCHGP.java
Index: TransformXPathFilterCHGP.java
===================================================================
RCS file: /home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPathFilterCHGP.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- TransformXPathFilterCHGP.java 2 Apr 2005 18:46:24 -0000 1.15
+++ TransformXPathFilterCHGP.java 2 Apr 2005 19:17:56 -0000 1.16
@@ -161,7 +161,7 @@
xpathContainer.getElement());
}
- this.includeSearchSet = nodeListToSet(includeButSearchNodes);
+ this.includeSearchSet = XMLUtils.convertNodelistToSet(includeButSearchNodes);
}
{
@@ -177,7 +177,7 @@
CachedXPathFuncHereAPI.getStrFromNode(excludeButSearchCtxNode),xpathContainer.getElement());
}
- this.excludeSearchSet = nodeListToSet(excludeButSearchNodes);
+ this.excludeSearchSet = XMLUtils.convertNodelistToSet(excludeButSearchNodes);
}
{
@@ -193,7 +193,7 @@
xpathContainer.getElement());
}
- this.excludeSet = nodeListToSet(excludeNodes);
+ this.excludeSet = XMLUtils.convertNodelistToSet(excludeNodes);
}
if (xpathContainer.getIncludeSlashPolicy()
@@ -318,27 +318,6 @@
}
/**
- * Copies all nodes from a given {@link NodeList} into a {@link Set}
- *
- * @param nl
- * @return nodelist as set
- */
- private static Set nodeListToSet(NodeList nl) {
-
- Set set = new HashSet();
- if (nl==null) {
- return set;
- }
- int iMax = nl.getLength();
-
- for (int i = 0; i < iMax; i++) {
- set.add(nl.item(i));
- }
-
- return set;
- }
-
- /**
* This {@link NodeFilter} always returns <code>true</code>
*
* @author Christian Geuer-Pollmann