Bug #10177
open
TreeVisitor's SKIP status does not work as expected
Added by Alexander Kamkin over 4 years ago.
Updated over 4 years ago.
Description
When I call setStatus(Status.SKIP)
in onOperationBegin(node)
, I expect the visitor will not visit the node's children but will visit the node's neighbors.
However, the call skips visiting the neighbors.
- Status changed from New to Feedback
Which TreeVisitor implementation behaves that way?
TreeVisitor and ExprTreeVisitor are interfaces, ExprTreeVisitorDefault is a stub that does not implement SKIP/ABORT logic.
Upon further investigation, I've found it is required to manually setStatus(Status.OK) in onOperationEnd() to continue traversal as normal, e.g.
public void onOperationEnd(NodeOperation node) {
if (getStatus() == Status.SKIP) {
setStatus(Status.OK);
}
}
IMHO, the status should be re-set automatically.
Also available in: Atom
PDF