Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15137

Duration converter does not parse the seconds fraction correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: came-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      In the DurationConverter, there are some edge cases are not handled correctly when fractions being used, e.g: DurationConverter.toDuration("5s").toMillis() will give the correct value of 5000 meanwhile DurationConverter.toDuration("5.5s").toMillis() will give 5005 which is wrong. Here is list of some edge cases:

      • DurationConverter.toDuration("5.5s").toMillis() -> 5001
      • DurationConverter.toDuration("0.01s").toMillis() -> 1
      • DurationConverter.toDuration("0.1").toMillis() -> 1
      • DurationConverter.toDuration("0.5s").toMillis() -> 5

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                omarsmak Omar Al-Safi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: