You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Shuo Geng (Jira)" <ji...@apache.org> on 2024/09/23 03:06:00 UTC

[jira] [Created] (JEXL-429) Regressions in 3.4.0

Shuo Geng created JEXL-429:
------------------------------

             Summary: Regressions in 3.4.0
                 Key: JEXL-429
                 URL: https://issues.apache.org/jira/browse/JEXL-429
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 3.4.0
            Reporter: Shuo Geng


{*}Regression #1{*}:
{code:java}
"1.1" > 0 {code}
returns *true* in 3.3. But it throws an exception in 3.4.0.
{code:java}
java.lang.ArithmeticException: Object comparison:(1.1 GT 0)
at org.apache.commons.jexl3.JexlArithmetic.doCompare(JexlArithmetic.java:806)
at org.apache.commons.jexl3.JexlArithmetic.compare(JexlArithmetic.java:503)
at org.apache.commons.jexl3.JexlArithmetic.greaterThan(JexlArithmetic.java:892)
at org.apache.commons.jexl3.internal.Interpreter.visit(Interpreter.java:1448)
at org.apache.commons.jexl3.parser.ASTGTNode.jjtAccept(ASTGTNode.java:19)
at org.apache.commons.jexl3.internal.Interpreter.visit(Interpreter.java:1532)
at org.apache.commons.jexl3.parser.ASTJexlScript.jjtAccept(ASTJexlScript.java:137)
at org.apache.commons.jexl3.internal.Interpreter.interpret(Interpreter.java:843)
at org.apache.commons.jexl3.internal.Script.execute(Script.java:239) {code}
{*}Regression #2{*}:
{code:java}
const f = function(a) {return a;}; 
b ? b : f(2);{code}
When the script is executed, there is a variable *b* in the jexl context with value as {*}1{*}. 

The script returns 1 as expected in 3.3, but throws a parsing exception in 3.4.0.
{code:java}
parsing error in ';'
    at org.apache.commons.jexl3.JexlEngine.createScript(JexlEngine.java:411) {code}
If the ternary statement is changed to {{b ? f(2) : b;}} , there is no issue and 2 is returned as expected. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)