Author: remy.maucherat(a)jboss.com
Date: 2011-04-27 03:21:56 -0400 (Wed, 27 Apr 2011)
New Revision: 1713
Modified:
branches/2.1.x/java/org/apache/el/lang/ELArithmetic.java
branches/3.0.x/java/org/apache/el/lang/ELArithmetic.java
Log:
47371: Fix empty string to number conversion (should be converted to 0).
Modified: branches/2.1.x/java/org/apache/el/lang/ELArithmetic.java
===================================================================
--- branches/2.1.x/java/org/apache/el/lang/ELArithmetic.java 2011-04-27 07:14:59 UTC (rev
1712)
+++ branches/2.1.x/java/org/apache/el/lang/ELArithmetic.java 2011-04-27 07:21:56 UTC (rev
1713)
@@ -353,12 +353,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(new Short((short) ((Character) obj).charValue()));
Modified: branches/3.0.x/java/org/apache/el/lang/ELArithmetic.java
===================================================================
--- branches/3.0.x/java/org/apache/el/lang/ELArithmetic.java 2011-04-27 07:14:59 UTC (rev
1712)
+++ branches/3.0.x/java/org/apache/el/lang/ELArithmetic.java 2011-04-27 07:21:56 UTC (rev
1713)
@@ -353,12 +353,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(new Short((short) ((Character) obj).charValue()));
Show replies by date