My guess: to avoid an infinate loop. insertNode() calls setParent(). If setParent() called insertNode(), chaos ensues.
Joined: Sep 29, 2004
it is possible to add child to children directly. Then there will not be a loop.
Joined: Aug 07, 2003
True, but then it has to pick where to insert it (top or bottom). But that just seems like a bug waiting to happen. The bottom line seems to be that you shouldn't call setParent() yourself; problem solved.