Skip to content

Commit 6e993b3

Browse files
committed
Add generics to JXPathContext.iterate(String)
1 parent d3f1012 commit 6e993b3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ The <action> type attribute can be add,update,fix,remove.
101101
[StepSecurity] ci: Harden GitHub Actions #66.
102102
</action>
103103
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName.</action>
104+
<action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.iterate(String).</action>
104105
<!-- ADD -->
105106
<action issue="JXPATH-123" dev="mbenson" type="add">
106107
XPath function "ends-with" is not implemented (although "starts-with" is).

src/main/java/org/apache/commons/jxpath/JXPathContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,12 @@ public List selectNodes(final String xpath) {
784784
* Traverses the xpath and returns an Iterator of all results found
785785
* for the path. If the xpath matches no properties
786786
* in the graph, the Iterator will be empty, but not null.
787+
*
788+
* @param <E> the type of elements returned by the iterator.
787789
* @param xpath to iterate
788790
* @return Iterator
789791
*/
790-
public abstract Iterator iterate(String xpath);
792+
public abstract <E> Iterator<E> iterate(String xpath);
791793

792794
/**
793795
* Traverses the xpath and returns a Pointer. A Pointer provides easy access

0 commit comments

Comments
 (0)