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

Can't do restore while a node has multiple children and order

    XMLWordPrintable

    Details

      Description

      This bug behaves the same as https://issues.jboss.org/browse/MODE-2034
      which reported by me.

      Cannot locate child node: a7ca2377505d644b426945-c0a2-4cf2-9c1d-bcd3a8057474 within parent: a7ca2377505d645ff023f2-aa23-4487-a53f-26771d2c24cc. Stacktrace follows:
      Message: Cannot locate child node: a7ca2377505d644b426945-c0a2-4cf2-9c1d-bcd3a8057474 within parent: a7ca2377505d645ff023f2-aa23-4487-a53f-26771d2c24cc

      For example, there're four child nodes(node1, node2, node3, other) located under the parent node, when doing restore, the insertion of context changes is:
      node1 insert before node2
      node2 insert before node3
      node3 insert before other

      the code located in L129 of AbstractChildReference.java

      if (insertions != null && nextAfterIter != next)

      { // prevent circular references nextAfterIter = next; iter = insertions.inserted().iterator(); continue; }

      which make the nextAfterIter not point to the correct node while retrieve the node has multiple node insert before. For example node3 will not be return instead return node2.

      I think it should be:

      if (insertions != null && nextAfterIter != next) { // prevent circular references
      if(nextAfterIter == null)

      { nextAfterIter = next; }

      iter = insertions.inserted().iterator();
      continue;
      }

      Any thoughts?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                angelo.chen Angelo Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: