}
}
private String diffImpl(Node from, Node to)
throws MicroKernelException {
JsopWriter w = new JsopStream();
diffProperties(from, to, w);
// TODO this does not work well for large child node lists
// use a document store index instead
int max = MANY_CHILDREN_THRESHOLD;
Node.Children fromChildren, toChildren;
fromChildren = getChildren(from, null, max);
toChildren = getChildren(to, null, max);
if (!fromChildren.hasMore && !toChildren.hasMore) {
diffFewChildren(w, fromChildren, from.getLastRevision(),
toChildren, to.getLastRevision());
} else {
if (FAST_DIFF) {
diffManyChildren(w, from.getPath(),
from.getLastRevision(), to.getLastRevision());
} else {
max = Integer.MAX_VALUE;
fromChildren = getChildren(from, null, max);
toChildren = getChildren(to, null, max);
diffFewChildren(w, fromChildren, from.getLastRevision(),
toChildren, to.getLastRevision());
}
}
return w.toString();
}