commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Neßelrath (JIRA) <j...@apache.org>
Subject [jira] [Created] (JEXL-169) A string is wrongly identified as FloatingPointNumber
Date Fri, 24 Jul 2015 14:45:06 GMT
Robert Neßelrath created JEXL-169:
-------------------------------------

             Summary: A string is wrongly identified as FloatingPointNumber
                 Key: JEXL-169
                 URL: https://issues.apache.org/jira/browse/JEXL-169
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 2.1.1
            Reporter: Robert Neßelrath
            Priority: Minor


When concatenating two strings with one containing an 'e' character, an ArithmeticException
is thrown.

The problem lies in the JexlArithmetic.isFloatingPointNumber() method in line 200.

return ((string.indexOf(46) != -1) || (string.indexOf(101) != -1) || (string.indexOf(69) !=
-1));

With this solution also the String "New York" or "hello.world" are floating point numbers.
A solution with a regular expression would be better



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message