commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject svn commit: r543749 - /jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTSizeMethod.java
Date Sat, 02 Jun 2007 15:13:38 GMT
Author: proyal
Date: Sat Jun  2 08:13:37 2007
New Revision: 543749

URL: http://svn.apache.org/viewvc?view=rev&rev=543749
Log:
make foo.size behave like foo.bar, returning null if foo is null.

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

Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTSizeMethod.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTSizeMethod.java?view=diff&rev=543749&r1=543748&r2=543749
==============================================================================
--- jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTSizeMethod.java
(original)
+++ jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/parser/ASTSizeMethod.java
Sat Jun  2 08:13:37 2007
@@ -60,6 +60,9 @@
      * @throws Exception on any error
      */
     public Object execute(Object obj, JexlContext jc) throws Exception {
+        if( null == obj ) {
+            return null;
+        }
         return new Integer(ASTSizeFunction.sizeOf(obj, getUberspect() ));
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message