private void associateClones ( Node n , Node snapshot ) { // TODO(johnlenz): determine if MODULE_BODY is useful here. if ( n . isRoot ( ) || NodeUtil . isChangeScopeRoot ( n ) ) { clonesByCurrent . put ( n , snapshot ) ; } Node child = n . getFirstChild ( ) ; Node snapshotChild = snapshot . getFirstChild ( ) ; while ( child != null ) { associateClones ( child , snapshotChild ) ; child = child . getNext ( ) ; snapshotChild = snapshotChild . getNext ( ) ; } }
Given an AST and its copy map the root node of each scope of main to the corresponding root node of clone