--- src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (revision 960235) +++ src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (working copy) @@ -62,6 +62,7 @@ @Test public void test49526WhenNotMapped() throws JspException { tag.setVar(VAR); + tag.valueSpecified = true; tag.value = VALUE; // verify mapper is checked but that no action is taken @@ -80,6 +81,7 @@ @Test public void test49526WhenAlreadyMapped() throws JspException { tag.setVar(VAR); + tag.valueSpecified = true; tag.value = VALUE; // verify mapper is checked and the mapped variable removed @@ -100,6 +102,7 @@ @Test public void test49526WhenNotUsingPageContext() throws JspException { tag.setVar(VAR); + tag.valueSpecified = true; tag.value = VALUE; tag.setScope("request"); --- src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (revision 960235) +++ src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (working copy) @@ -183,24 +183,18 @@ } Object getResult() { - Object result; // what we'll store in scope:var - - // determine the value by... - if (value != null) { - // ... reading our attribute - result = value; - } else if (valueSpecified) { - // ... accepting an explicit null - result = null; + if (valueSpecified) { + return value; + } else if (bodyContent == null) { + return ""; } else { - // ... retrieving and trimming our body - if (bodyContent == null || bodyContent.getString() == null) - result = ""; - else - result = bodyContent.getString().trim(); + String content = bodyContent.getString(); + if (content == null) { + return ""; + } else { + return content.trim(); + } } - - return result; } /**