Create subnode list if it doesn't exist in Node.getLastSubnodeChange(). Fixes bug #679
http://dev.helma.org/bugs/show_bug.cgi?id=679
This commit is contained in:
parent
f2904d1f29
commit
daf3b0b292
1 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue