Proper fix for Anchor and TreeLabel to clear state after the current tag is finished

This commit is contained in:
Travis Burtrum 2014-10-13 11:31:53 -04:00
parent 898ce9533a
commit c82f7ed3fc
2 changed files with 9 additions and 6 deletions

View File

@ -325,8 +325,6 @@ public class Anchor extends AnchorBase
bodyContent.clearBody();
if (value.length() > 0)
_text = value;
else
_text = null;
}
return SKIP_BODY;
}
@ -372,4 +370,10 @@ public class Anchor extends AnchorBase
return EVAL_PAGE;
}
@Override
protected void localRelease() {
super.localRelease();
_text = null;
_value = null;
}
}

View File

@ -36,8 +36,6 @@ public class TreeLabel extends AbstractSimpleTag
{
private static final Logger logger = Logger.getInstance(TreeLabel.class);
private String _text;
/**
* Return the name of the Tag.
*/
@ -54,8 +52,9 @@ public class TreeLabel extends AbstractSimpleTag
throws JspException, IOException
{
String value = getBufferBody(true);
String text = "";
if (value.length() > 0)
_text = value;
text = value;
Object o = getParent();
assert (o != null);
@ -66,6 +65,6 @@ public class TreeLabel extends AbstractSimpleTag
// assign the value to the parent's label value
TreeItem ti = (TreeItem) o;
ti.setItemLabel(_text);
ti.setItemLabel(text);
}
}