I am curiose about the behavior of ExpressionImpl.getVariables(). Some cases 
not all of the variables are reported. Is this by design?





 @Test
    public void testJexlEngine(){
        JexlEngine engine = new JexlEngine();

        engine.setSilent(false);
        engine.setLenient(false);
        engine.setDebug(true);

        String exp = "(A)";
        ExpressionImpl jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The variables: " + jexlExp.getVariables());

        exp = "not(A)";
        jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The features: " + jexlExp.getVariables());

        exp = "not((A))";
        jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The features: " + jexlExp.getVariables());

    }





[junit] 10:51:20,868 DEBUG TestParser:85 - The jexlExpression: (A)

[junit] 10:51:20,873 DEBUG TestParser:86 - The variables: [[A]]

[junit] 10:51:20,874 DEBUG TestParser:90 - The jexlExpression: not(A)

[junit] 10:51:20,874 DEBUG TestParser:91 - The features: [[A]]

[junit] 10:51:20,875 DEBUG TestParser:95 - The jexlExpression: not((A))

[junit] 10:51:20,943 DEBUG TestParser:96 - The features: []






Reply via email to