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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 3.7.0.Final, 3.3.x-prod-ip6.0
    • 3.3.0.Final, 3.6.0.Final
    • None
    • None

    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?

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            angelo.chen Angelo Chen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: