On 14 June 2011 14:33,  <hen...@apache.org> wrote:
> Author: henrib
> Date: Tue Jun 14 13:33:09 2011
> New Revision: 1135562
>
> URL: http://svn.apache.org/viewvc?rev=1135562&view=rev
> Log:
> JEXL-24, JEXL-112: added syntax for literals of type long integer, big 
> integer, double, big decimal
>

...

> --- 
> commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
>  (original)
> +++ 
> commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
>  Tue Jun 14 13:33:09 2011
> @@ -19,8 +19,6 @@ package org.apache.commons.jexl2;

...

>     public Object visit(ASTNotNode node, Object data) {
>         Object val = node.jjtGetChild(0).jjtAccept(this, data);
> @@ -1051,7 +1040,7 @@ public class Interpreter implements Pars
>         for (int c = 0; c < numChildren; c++) {
>             JexlNode theNode = node.jjtGetChild(c);
>             // integer literals may be part of an antish var name only if no 
> bean was found so far
> -            if (result == null && theNode instanceof ASTIntegerLiteral) {
> +            if (result == null && theNode instanceof ASTNumberLiteral && 
> theNode.image.matches("\\d*")) {

Is the empty string allowed as a number? I would expect to see at
least one digit, i.e. "\\d+"
If there is a good reason for allowing no digits, please add a comment
to say why.

>                 isVariable &= v > 0;
>             } else {
>                 isVariable &= (theNode instanceof ASTIdentifier);
> @@ -1083,7 +1072,7 @@ public class Interpreter implements Pars
>         ASTArrayAccess upper = (ASTArrayAccess) node;
>         return visit(upper, data);

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

Reply via email to