Author: dion
Date: Mon Apr 17 08:57:12 2006
New Revision: 394720

URL: http://svn.apache.org/viewcvs?rev=394720&view=rev
Log:
No need for conditional as coercion methods handle null

Modified:
    
jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTAddNode.java

Modified: 
jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTAddNode.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTAddNode.java?rev=394720&r1=394719&r2=394720&view=diff
==============================================================================
--- 
jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTAddNode.java
 (original)
+++ 
jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTAddNode.java
 Mon Apr 17 08:57:12 2006
@@ -82,9 +82,8 @@
 
             try
             {
-                Double l = left == null ? new Double(0) : 
Coercion.coerceDouble(left);
-                Double r = right == null? new Double(0) : 
Coercion.coerceDouble(right);
-
+                Double l = Coercion.coerceDouble(left);
+                Double r = Coercion.coerceDouble(right);
                 return new Double(l.doubleValue() + r.doubleValue());
             }
             catch( java.lang.NumberFormatException nfe )
@@ -101,8 +100,8 @@
          */
         try
         {
-            Long l = left == null ? new Long(0) : Coercion.coerceLong(left);
-            Long r = right == null ? new Long(0) : Coercion.coerceLong(right);
+            Long l = Coercion.coerceLong(left);
+            Long r = Coercion.coerceLong(right);
             return new Long(l.longValue() + r.longValue());
         }
         catch( java.lang.NumberFormatException nfe )



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to