[
https://issues.apache.org/jira/browse/JEXL-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lars Helge Ă˜verland updated JEXL-172:
-------------------------------------
Description:
It seems that evaluating expressions which contains nested divisions causes an
exception to be thrown with cause "divide error".
The following expression is valid math and should return 100:
1 / (1 / 100)
Instead it throws:
org.apache.commons.jexl2.JexlException:
org.hisp.dhis.commons.util.ExpressionUtils.evaluate@81![0,13]: '1 / (1 / 100);'
divide error
This only applies to strict mode. However it could be argued that this should
pass even in strict mode.
I could not find anything in the docs about this so please excuse me if I
missed something.
was:
It seems that evaluating expressions which contains nested divisions causes an
exception to be thrown with cause "divide error".
The following expression is valid math and should return 100:
1 / (1 / 100)
Instead it throws
org.apache.commons.jexl2.JexlException:
org.hisp.dhis.commons.util.ExpressionUtils.evaluate@81![0,13]: '1 / (1 / 100);'
divide error
This only applies to strict mode. However it could be argued that this should
pass even in strict mode.
I could not find anything in the docs about this so please excuse me if I
missed something.
> Unexpected divide error for numerator which contains division in strict mode
> ----------------------------------------------------------------------------
>
> Key: JEXL-172
> URL: https://issues.apache.org/jira/browse/JEXL-172
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 2.1.1
> Environment: Java 7 OpenJDK
> Reporter: Lars Helge Ă˜verland
> Priority: Minor
>
> It seems that evaluating expressions which contains nested divisions causes
> an exception to be thrown with cause "divide error".
> The following expression is valid math and should return 100:
> 1 / (1 / 100)
> Instead it throws:
> org.apache.commons.jexl2.JexlException:
> org.hisp.dhis.commons.util.ExpressionUtils.evaluate@81![0,13]: '1 / (1 /
> 100);' divide error
> This only applies to strict mode. However it could be argued that this should
> pass even in strict mode.
> I could not find anything in the docs about this so please excuse me if I
> missed something.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)