Author: remy.maucherat(a)jboss.com
Date: 2011-04-27 03:14:59 -0400 (Wed, 27 Apr 2011)
New Revision: 1712
Modified:
trunk/java/org/apache/el/lang/ELArithmetic.java
trunk/webapps/docs/changelog.xml
Log:
- Fix bad code for conversion of empty string to number.
Modified: trunk/java/org/apache/el/lang/ELArithmetic.java
===================================================================
--- trunk/java/org/apache/el/lang/ELArithmetic.java 2011-04-21 14:10:45 UTC (rev 1711)
+++ trunk/java/org/apache/el/lang/ELArithmetic.java 2011-04-27 07:14:59 UTC (rev 1712)
@@ -394,12 +394,12 @@
if (isNumber(obj)) {
return coerce((Number) obj);
}
+ if (obj == null || "".equals(obj)) {
+ return coerce(ZERO);
+ }
if (obj instanceof String) {
return coerce((String) obj);
}
- if (obj == null || "".equals(obj)) {
- return coerce(ZERO);
- }
if (obj instanceof Character) {
return coerce(Short.valueOf((short) ((Character) obj).charValue()));
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-04-21 14:10:45 UTC (rev 1711)
+++ trunk/webapps/docs/changelog.xml 2011-04-27 07:14:59 UTC (rev 1712)
@@ -27,6 +27,13 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <bug>47371</bug>: Fix conversion from empty string to number in EL.
(remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 7.0.0.Beta11 (remm)">
Show replies by date