Looks great. Just two tiny remarks:

  • NodeUtil.getSameNameSiblingNode() calls itself recursively so it might fail with stack overflow when importing very deep tree. You can avoid deep recursion for example by using something like:
    List<NodeIterator> iters = new ArrayList<NodeIterator>();
    iters.add(node.getNodes());
    while (!iters.isEmpty()) {
      List<NodeIterator> tmp = updateChildren(iters);
      iters.clear();
      iters.addAll(tmp);
    }
    private List<NodeIterator> updateChildren(List<NodeIterator> iters) {
      List<NodeIterator> tmp = new ArrayList<NodeIterator>();
      for (NodeIterator iter : iters) {
        while (iter.hasNext()) {
          Node node = iter.nextNode();
          // do some business logic
          tmp.add(node.getNodes());
        }
      }
      return tmp;
    }
    
  • testImportXmlWithSameNameSiblings() is actually multiple tests. Please split them. Having all together makes it harder to find out what exactly is failing when test starts to fail since the first failure is preventing other checks in that test to be executed.
Change By: Jan Haderka (29/Oct/13 6:29 AM)
Resolution: Fixed

        
Status: Resolved Reopened
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to