Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-89

Cannot compare pointers that do not belong to the same tree

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final, Nightly Builds
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      codebase: 1.2 or latest version from SVN, JDK 1.4

      Description

      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)

        Attachments

        1. VariablePointerTestCase.java
          3 kB
          Sergey Vladimirov
        2. VariablePointerTestCase.java
          4 kB
          Sergey Vladimirov
        3. hack-patch.txt
          3 kB
          Sergey Vladimirov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bsp Sergey Vladimirov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: