You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/11/16 16:06:34 UTC
(commons-jxpath) branch master updated: Add generics to JXPathContext.iterate(String)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jxpath.git
The following commit(s) were added to refs/heads/master by this push:
new 6e993b3 Add generics to JXPathContext.iterate(String)
6e993b3 is described below
commit 6e993b34298acc657ddf92fddaa8c9c1392ef7cf
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 16 11:06:30 2024 -0500
Add generics to JXPathContext.iterate(String)
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/jxpath/JXPathContext.java | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cd8a565..dcaa9c3 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -101,6 +101,7 @@ The <action> type attribute can be add,update,fix,remove.
[StepSecurity] ci: Harden GitHub Actions #66.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName.</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.iterate(String).</action>
<!-- ADD -->
<action issue="JXPATH-123" dev="mbenson" type="add">
XPath function "ends-with" is not implemented (although "starts-with" is).
diff --git a/src/main/java/org/apache/commons/jxpath/JXPathContext.java b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
index 814eb6b..c77cff0 100644
--- a/src/main/java/org/apache/commons/jxpath/JXPathContext.java
+++ b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
@@ -784,10 +784,12 @@ public abstract class JXPathContext {
* Traverses the xpath and returns an Iterator of all results found
* for the path. If the xpath matches no properties
* in the graph, the Iterator will be empty, but not null.
+ *
+ * @param <E> the type of elements returned by the iterator.
* @param xpath to iterate
* @return Iterator
*/
- public abstract Iterator iterate(String xpath);
+ public abstract <E> Iterator<E> iterate(String xpath);
/**
* Traverses the xpath and returns a Pointer. A Pointer provides easy access