diff --git a/src/template/incremental/Notification.tt b/src/template/incremental/Notification.tt index 55a1267371d24b4edd8ee641d47a5722e31f9f8e..05fc06d10403598081f4abc96890ee360cea69ab 100644 --- a/src/template/incremental/Notification.tt +++ b/src/template/incremental/Notification.tt @@ -902,8 +902,13 @@ $endif $endif $if(IncrementalLevelParam) + private boolean #name.inc_flush_subtree_visited = false; /** @apilevel internal */ protected void #name.inc_flush_subtree($DDGNodeName h) { + if (inc_flush_subtree_visited) { + return; + } + inc_flush_subtree_visited = true; inc_state = inc_GARBAGE; $FlushNtaSubTrees $TransferSetsFromAttrTokenHandlers @@ -923,6 +928,7 @@ $if(#isASTNodeDecl) $else super.inc_flush_subtree(h); $endif + inc_flush_subtree_visited = false; } $endif diff --git a/src/template/incremental/State.tt b/src/template/incremental/State.tt index 1cf8fce4e6cda74c3ef273736b8578896edef4f9..fbc6124904e0db30bd3ccd92e5be2461aebf991c 100644 --- a/src/template/incremental/State.tt +++ b/src/template/incremental/State.tt @@ -156,8 +156,13 @@ $endif ]] ASTDecl.incChangeStateMethod = [[ +private boolean #name.inc_changeState_visited = false; /** @apilevel internal */ public void #name.inc_changeState(int newState) { + if (inc_changeState_visited) { + return; + } + inc_changeState_visited = true; $if(#isASTNodeDecl) inc_state = newState; @@ -214,6 +219,7 @@ $else $endif $ChangeStateTokens $ChangeStateAttributes + inc_changeState_visited = false; } ]] @@ -262,8 +268,13 @@ $endif ]] ASTDecl.incThrowAwayMethod = [[ +private boolean #name.inc_throwAway_visited = false; /** @apilevel internal */ public void #name.inc_throwAway() { + if (inc_throwAway_visited) { + return; + } + inc_throwAway_visited = true; inc_state = inc_GARBAGE; $if(#isASTNodeDecl) $if(IncrementalLevelParam) @@ -315,6 +326,7 @@ $else $endif $ThrowAwayTokens $ThrowAwayAttributes + inc_throwAway_visited = false; } ]]