commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Helge Øverland (JIRA) <j...@apache.org>
Subject [jira] [Created] (JEXL-172) Unexpected divide error for numerator which contains division in strict mode
Date Tue, 04 Aug 2015 12:23:04 GMT
Lars Helge Øverland created JEXL-172:
----------------------------------------

             Summary: 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)

Mime
View raw message