Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-430

ReadBranchRequest.iterator() returns too many nodes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.5
    • 0.4
    • Graph (2.x), Storage
    • None
    • Low

      The ReadBranchRequest.iterator() method returns an iterator that walks (in pre-order traversal) the nodes that were set as results on the request. The iterator is to walk all the nodes in the branch and should not include the children of the bottom nodes in the branch. However, this is what the iterator is currently doing.

      For example, consider a graph in a repository:
      A
      +- B

      +- C
      +- D

      If the ReadRequestBranch is submitted with a path of '/A' and maximum depth of 2, then the branch should include all the properties and children for nodes A, B and D. Node C should not be included in the branch because it is below the maximum depth. The current implementation of the iterator is also returning node C; not only is this wrong, but it also generates an NPE when iterating.

            rhauch Randall Hauch (Inactive)
            rhauch Randall Hauch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: