122123124125126127128129130131132
if (!x.isMatched() && (!x.isLeaf() || x.isRoot())) { for (Enumeration<Node> rightNodes = right.postorderEnumeration(); rightNodes.hasMoreElements() && !x.isMatched();) { Node y = rightNodes.nextElement(); if ((!y.isMatched() && (!y.isLeaf() || y.isRoot())) && equal(x, y)) { fMatch.add(new NodePair(x, y)); x.enableMatched(); y.enableMatched(); } } }
112113114115116117118
createMatchSet(); assertNodesAreMatched(whileStatementLeft, whileStatementRight); } private void assertNodesAreMatched(Node left, Node right) { assertThat(fMatchSet, hasItem(new NodePair(left, right))); }
116117118119120121122
private void assertNodesAreMatched(Node left, Node right) { assertThat(fMatchSet, hasItem(new NodePair(left, right))); } private void assertNodesAreNotMatched(Node left, Node right) { assertThat(fMatchSet, not(hasItem(new NodePair(left, right)))); }