-1

Why is the following code returning TRUE when it is obviously not TRUE?

        ExpressionParser parser = new SpelExpressionParser();
        Integer   s = new Integer(132);

        EvaluationContext context = new StandardEvaluationContext();
        context.setVariable("rpaCount", s);
        Expression exp = parser.parseExpression("#rpaCount>1000"); 
        Boolean truth = (Boolean)exp.getValue();


        System.out.println(truth); // returning TRUE ....HOW is 132 > 1000?
vamshi
  • 31
  • 2

1 Answers1

0

It seems the context is null and is why the expression is not getting evaluated correctly. I fully did not understand the usage of EvaluationContext and hence the confusion. Closing the question after clarifying the usage of EvaluationContext.

vamshi
  • 31
  • 2