/** * Returns a clone of subtree that includes all joint children starting from * this node itself and till the first occurrence of non-joint node * * @since 3.1 */ public PrefetchTreeNode cloneJointSubtree() { return cloneJointSubtree(null); }
PrefetchTreeNode jointSubtree = node.cloneJointSubtree();
private PrefetchTreeNode cloneJointSubtree(PrefetchTreeNode parent) { PrefetchTreeNode cloned = new PrefetchTreeNode(parent, getName()); if (parent != null) { cloned.setSemantics(getSemantics()); cloned.setPhantom(isPhantom()); } if (children != null) { for (PrefetchTreeNode child : children) { if (child.isJointPrefetch()) { cloned.addChild(child.cloneJointSubtree(cloned)); } } } return cloned; }