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

Duration converter does not parse the seconds fraction correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • None
    • 3.4.0
    • came-core
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: