Currently, NodeTraversor crashes when its NodeVisitor removes the current Node from tail(). This change safeguards that behavior by bookkeeping .parent() and .nextSibling() inside the traversal loop.
Also added a test class for NodeTraversor with a test for head() and tail() traversal order.
Currently,
NodeTraversor
crashes when itsNodeVisitor
removes the currentNode
fromtail()
. This change safeguards that behavior by bookkeeping.parent()
and.nextSibling()
inside the traversal loop.Also added a test class for
NodeTraversor
with a test forhead()
andtail()
traversal order.