r9991 - helma/helma/trunk/src/helma/objectmodel/db

[email protected] Tue, 24 Nov 2009 11:25:31 +0100 (CET)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20091124102531.54A563D0E2@mia>
Author: hannes
Date: 2009-11-24 11:25:31 +0100 (Tue, 24 Nov 2009)
New Revision: 9991

Modified:
   helma/helma/trunk/src/helma/objectmodel/db/Node.java
Log:
Undo commit 9990 - not calling loadNodes() in addNode() breaks two unit tests involving grouped collections.

Details at http://dev.helma.org/trac/helma/changeset/9991

Modified: helma/helma/trunk/src/helma/objectmodel/db/Node.java
===================================================================
--- helma/helma/trunk/src/helma/objectmodel/db/Node.java	2009-11-18 14:21:00 UTC (rev 9990)
+++ helma/helma/trunk/src/helma/objectmodel/db/Node.java	2009-11-24 10:25:31 UTC (rev 9991)
@@ -762,11 +762,15 @@
             node.markAs(MODIFIED);
         }
 
-        // check if this node has a group-by subnode-relation
-        Node groupbyNode = getGroupbySubnode(node, true);
-        if (groupbyNode != null) {
-            groupbyNode.addNode(node);
-            return node;
+        loadNodes();
+
+        if (subrel != null && subrel.groupby != null) {
+            // check if this node has a group-by subnode-relation
+            Node groupbyNode = getGroupbySubnode(node, true);
+            if (groupbyNode != null) {
+                groupbyNode.addNode(node);
+                return node;
+            }
         }
 
         NodeHandle nhandle = node.getHandle();