You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2011/06/14 18:46:11 UTC

Re: svn commit: r1135562 - in /commons/proper/jexl/trunk/src: main/java/org/apache/commons/jexl2/ main/java/org/apache/commons/jexl2/internal/introspection/ main/java/org/apache/commons/jexl2/parser/ test/java/org/apache/commons/jexl2/

On 14 June 2011 14:33,  <he...@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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org