Skip to content

Commit

Permalink
Merge pull request #224 from volosied/fix-xpath-castclassexception
Browse files Browse the repository at this point in the history
Change generic in JSTLNodeList to object; fixes tck failure
  • Loading branch information
volosied authored Apr 1, 2022
2 parents e7c1d31 + 3b3a8c8 commit 1d309ba
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public boolean booleanValueOf(Node contextNode, String xpathString)
/**
* Evaluate an XPath expression to a List of nodes.
*/
public List<Node> selectNodes(Node contextNode, String xpathString)
public List<Object> selectNodes(Node contextNode, String xpathString)
throws JspTagException {
XPathVariableResolver jxvr = new JSTLXPathVariableResolver(pageContext);

Expand Down Expand Up @@ -284,11 +284,11 @@ public static void printDetails(Node n) {
}
}

class JSTLNodeList extends Vector<Node> implements NodeList {
class JSTLNodeList extends Vector<Object> implements NodeList {

Vector<Node> nodeVector;
Vector<Object> nodeVector;

public JSTLNodeList ( Vector<Node> nodeVector ) {
public JSTLNodeList ( Vector<Object> nodeVector ) {
this.nodeVector = nodeVector;
}

Expand Down Expand Up @@ -318,22 +318,22 @@ public JSTLNodeList (Object o) {
nodeVector.add(i, nl.item(i) );
}
} else {
nodeVector.addElement((Node) o );
nodeVector.addElement( o );
}
}

@Override
public Node item ( int index ) {
return nodeVector.elementAt( index );
return (Node) nodeVector.elementAt( index );
}

@Override
public Node elementAt ( int index ) {
public Object elementAt ( int index ) {
return nodeVector.elementAt( index );
}

@Override
public Node get( int index ) {
public Object get( int index ) {
return nodeVector.get( index );
}

Expand Down

0 comments on commit 1d309ba

Please sign in to comment.