[ 
https://issues.apache.org/jira/browse/JXPATH-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509884
 ] 

Matt Benson commented on JXPATH-89:
-----------------------------------

Pretending a variable is a child of some random parent seems like the 
workaround to me.  I removed the exception because I saw the problem 
differently:  if two nodes have no common parents, then their comparison is 
undefined and thus irrelevant.  I'm not sure what you're referring to when you 
say sorting is not working.  The existing testcases that relied on the sort did 
not break, so I can only assume you're talking about sorting things that 
formerly broke in the manner of your original report.  Can you provide an 
example and explain what expectations you have that are not being met?

> Cannot compare pointers that do not belong to the same tree
> -----------------------------------------------------------
>
>                 Key: JXPATH-89
>                 URL: https://issues.apache.org/jira/browse/JXPATH-89
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: Nightly Builds, 1.2 Final
>         Environment: codebase: 1.2 or latest version from SVN, JDK 1.4
>            Reporter: Sergey Vladimirov
>             Fix For: 1.3
>
>         Attachments: VariablePointerTestCase.java
>
>
> For XPath "$var | /MAIN/A" exception is thrown:
> org.apache.commons.jxpath.JXPathException: Cannot compare pointers that do 
> not belong to the same tree: '$var' and ''
>       at 
> org.apache.commons.jxpath.ri.model.NodePointer.compareNodePointers(NodePointer.java:665)
>       at 
> org.apache.commons.jxpath.ri.model.NodePointer.compareNodePointers(NodePointer.java:649)
>       at 
> org.apache.commons.jxpath.ri.model.NodePointer.compareNodePointers(NodePointer.java:649)
>       at 
> org.apache.commons.jxpath.ri.model.NodePointer.compareTo(NodePointer.java:639)
>       at java.util.Arrays.mergeSort(Arrays.java:1152)
>       at java.util.Arrays.sort(Arrays.java:1079)
>       at java.util.Collections.sort(Collections.java:113)
>       at 
> org.apache.commons.jxpath.ri.EvalContext.constructIterator(EvalContext.java:176)
>       at 
> org.apache.commons.jxpath.ri.EvalContext.hasNext(EvalContext.java:100)
>       at 
> org.apache.commons.jxpath.JXPathContext.selectNodes(JXPathContext.java:648)
>       at 
> org.apache.commons.jxpath.ri.model.VariablePointerTestCase.testUnionOfVariableAndNode(VariablePointerTestCase.java:76)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to