From daf3b0b292217f9e47e4a28e24217b9f57cc4066 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 4 Nov 2009 10:56:15 +0000 Subject: [PATCH] Create subnode list if it doesn't exist in Node.getLastSubnodeChange(). Fixes bug #679 http://dev.helma.org/bugs/show_bug.cgi?id=679 --- src/helma/objectmodel/db/Node.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index e1cb4fd9..12cc7239 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -1038,19 +1038,16 @@ public final class Node implements INode { } /** - * - * - * @param index ... - * - * @return ... + * Get a node at a given position. This causes the subnode list to be loaded in case + * it isn't up to date. + * @param index the subnode index + * @return the node at the given index */ public INode getSubnodeAt(int index) { loadNodes(); - if (subnodes == null) { return null; } - return subnodes.getNode(index); } @@ -1452,7 +1449,10 @@ public final class Node implements INode { */ long getLastSubnodeChange() { // TODO check if we should compute this on demand - return subnodes == null ? 0 : subnodes.getLastSubnodeChange(); + if (subnodes == null) { + createSubnodeList(); + } + return subnodes.getLastSubnodeChange(); } /**