private TreeNode getParentTreeNode ( TreeNode child ) { TreeNode parentTreeNode = parentIndex . get ( child ) ; if ( parentTreeNode == null ) return null ; // Makes sure the parent node is still present in the tree else if ( contains ( parentTreeNode . getQueryNode ( ) ) ) return parentTreeNode ; else throw new RuntimeException ( "Internal error: points to a parent that is not (anymore) in the tree" ) ; }
The returned value might be null .