(Omit source code)
Make sure that child is the last sibling if (child != null) { while (child.getNextSibling() != null) { child = child.getNextSibling(); } }
if (child != null) { while (child.getNextSibling() != null) { child = child.getNextSibling(); } }
Copy an ASTPair. Don't call it clone() because we want type-safety ASTPair tmp = new ASTPair(); tmp.root = root; tmp.child = child; return tmp;
ASTPair tmp = new ASTPair(); tmp.root = root; tmp.child = child; return tmp;
String r = root == null ? "null" : root.getText(); String c = child == null ? "null" : child.getText(); return "[" + r + "," + c + "]";