protected void processNodeAndObserve(Node node){
  if (isParent(node)) {
    Parent parent=(Parent)node;
    final ObservableList<Node> children=parent.getChildrenUnmodifiable();
    for (int i=0; i < children.size(); i++) {
      Node child=children.get(i);
      processNodeAndObserve(child);
    }
    final ListChangeListener<Node> childrenListChangeListener=(ListChangeListener<Node>)null;
    listeners.add(childrenListChangeListener);
    children.addListener(new WeakListChangeListener<Node>(childrenListChangeListener));
  }
  registerLeakDetection(node);
}

protected void processNodeAndObserve ( Node node ) { if ( isParent ( node ) ) { Parent parent = ( Parent ) node ; final ObservableList < Node > children = parent . getChildrenUnmodifiable ( ) ; for ( int i = 0 ; i < children . size ( ) ; i ++ ) { Node child = children . get ( i ) ; processNodeAndObserve ( child ) ; } final ListChangeListener < Node > childrenListChangeListener = ( ListChangeListener < Node > ) null ; listeners . add ( childrenListChangeListener ) ; children . addListener ( new WeakListChangeListener < Node > ( childrenListChangeListener ) ) ; } registerLeakDetection ( node ) ; }
the current node and his children ( recursive ) gets registered for children tracking and memory leak tracking . in addition a lister for new children is registered , to apply the checks to new children also .
