Actions
Bug #10177
openTreeVisitor's SKIP status does not work as expected
Start date:
03/24/2020
Due date:
% Done:
0%
Estimated time:
Detected in build:
git
Platform:
Published in build:
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.
Updated by Artem Kotsynyak over 4 years ago
- 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.
Updated by Artem Kotsynyak over 4 years ago
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);
}
}
Updated by Alexander Kamkin over 4 years ago
IMHO, the status should be re-set automatically.
Actions