Author: markt
Date: Fri Jan 4 22:08:43 2013
New Revision: 1429156
URL: http://svn.apache.org/viewvc?rev=1429156&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54338
Correctly coerce the value to the expected type when using the tag plug-in for
the JSTL set tag. Patch provided by Sheldon Shao.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1429153
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java?rev=1429156&r1=1429155&r2=1429156&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java
Fri Jan 4 22:08:43 2013
@@ -144,7 +144,7 @@ public class Set implements TagPlugin {
//invoke the method through the reflection
ctxt.generateJavaSource(" if(" + resultName + "
!= null){");
- ctxt.generateJavaSource(" " + methodName +
".invoke(" + targetName + ", new Object[]{(" + methodName +
".getParameterTypes()[0]).cast(" + resultName + ")});");
+ ctxt.generateJavaSource(" " + methodName +
".invoke(" + targetName + ", new
Object[]{org.apache.el.lang.ELSupport.coerceToType(" + resultName + ", " +
methodName + ".getParameterTypes()[0])});");
ctxt.generateJavaSource(" }else{");
ctxt.generateJavaSource(" " + methodName +
".invoke(" + targetName + ", new Object[]{null});");
ctxt.generateJavaSource(" }");
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1429156&r1=1429155&r2=1429156&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Jan 4 22:08:43 2013
@@ -104,6 +104,11 @@
<bug>54370</bug>: Improve handling of nulls when trying to match sets
of
parameters to a method in EL. (markt)
</fix>
+ <fix>
+ <bug>54338</bug>: Correctly coerce the value to the expected type when
+ using the tag plug-in for the JSTL set tag. Patch provided by Sheldon
+ Shao. (markt)
+ </fix>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]