Repository: tapestry-5 Updated Branches: refs/heads/master fa7634ac7 -> 69a689d45
TAP5-2450, TAP5-2445: Reset the renderTag field in the AfterRender phase, fixes state leak when using an AbstractConditional within a Loop Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/69a689d4 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/69a689d4 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/69a689d4 Branch: refs/heads/master Commit: 69a689d45055c1c4fae7a1fcf53422052cfca890 Parents: fa7634a Author: Jochen Kemnade <[email protected]> Authored: Tue Feb 10 09:04:53 2015 +0100 Committer: Jochen Kemnade <[email protected]> Committed: Tue Feb 10 09:04:53 2015 +0100 ---------------------------------------------------------------------- .../org/apache/tapestry5/corelib/base/AbstractConditional.java | 1 + .../org/apache/tapestry5/integration/pagelevel/IfTest.java | 1 + .../apache/tapestry5/integration/app2/pages/TestPageForIf.tml | 6 ++++++ 3 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/69a689d4/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java index ceae009..4402d1e 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractConditional.java @@ -88,6 +88,7 @@ public abstract class AbstractConditional if (renderTag) { writer.end(); + renderTag = false; } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/69a689d4/tapestry-core/src/test/java/org/apache/tapestry5/integration/pagelevel/IfTest.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/pagelevel/IfTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/pagelevel/IfTest.java index dd573c1..d924b40 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/pagelevel/IfTest.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/pagelevel/IfTest.java @@ -34,6 +34,7 @@ public class IfTest extends Assert assertNotNull(doc.getElementById("3")); assertNotNull(doc.getElementById("5")); assertNotNull(doc.getElementById("8")); + assertNotNull(doc.getElementById("9")); assertNull(doc.getElementById("2")); assertNull(doc.getElementById("4")); assertNull(doc.getElementById("6")); http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/69a689d4/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForIf.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForIf.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForIf.tml index 65e4221..48b985d 100644 --- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForIf.tml +++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForIf.tml @@ -23,4 +23,10 @@ <p id="8">hey.</p> </t:parameter> </t:if> + <!-- TAP5-2450 --> + <t:loop source="[true,false]" value="var:value"> + <div t:type="if" test="var:value"> + <p id="9">foo</p> + </div> + </t:loop> </html>
