[
https://issues.apache.org/jira/browse/JEXL-355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro resolved JEXL-355.
--------------------------------
Assignee: Henri Biestro
Resolution: Not A Bug
Literals with a leading zero are octal literals, same as Java. Octal numbers
can only use digits 0-7, just like decimal can use 0-9, binary can use 0-1 and
hexadecimal 0-9,A-F.
0900 generates a syntax error since 9 is not in the acceptable digit range.
> Conditional operation fails
> ---------------------------
>
> Key: JEXL-355
> URL: https://issues.apache.org/jira/browse/JEXL-355
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 3.1, 3.2.1
> Reporter: Renato
> Assignee: Henri Biestro
> Priority: Major
>
> I'm evaluating time interval and I noticed a strange behaviour when, for
> example, I've tried to create an expression like this:
>
> {code:java}
> new JexlBuilder().create().createExpression("0900 >= 0900"){code}
>
> this fails with the following message:
> ??org.apache.commons.jexl3.JexlException$Parsing: :2 parsing error in '900'??
> ?? at
> org.apache.commons.jexl3.JexlEngine.createExpression(JexlEngine.java:335)??
> ?? at
> it.bookingexpert.be.bebeeval.logic.jexl.JexlEvaluator.internalEval(JexlEvaluator.java:39)??
> ?? ... 27 more??????
> as well as this one
> {code:java}
> new JexlBuilder().create().createExpression("0800 >= 0800")
> {code}
>
> but won't if I replace {{0800 }}with one of the following
> {{0100, 0200, 0300, 0400, 0500, 0600, 0700}}
> {{If I remove the first 0 in all the previous expressions, then everything
> will work.}}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)