private QueryTreeNode cloneTrunk ( QueryTreeNode stop , QueryTreeNode stopClone ) { QueryTreeNode node1 = null ; if ( n1 != null ) { node1 = ( n1 == stop ? stopClone : n1 . cloneBranch ( ) ) ; } QueryTreeNode node2 = null ; if ( n2 != null ) { node2 = n2 == stop ? stopClone : n2 . cloneBranch ( ) ; } QueryTreeNode ret = cloneSingle ( node1 , t1 , node2 , t2 ) ; if ( p != null ) { p . cloneTrunk ( this , ret ) ; } ret . relateToChildren ( ) ; return ret ; }
Clones a tree upwards to the root except for the branch that starts with stop which is replaced by stopClone .