Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-169

A string is wrongly identified as FloatingPointNumber

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              henrib Henri Biestro
              Reporter:
              rnesselrath Robert Ne├čelrath
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: