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

Incorrect caching type converter misses for NaN

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.3
    • 2.8.5, 2.9.1, 2.10.0
    • camel-core
    • None
    • Novice

    Description

      When converting Double or Float with value NaN, org.apache.camel.converter.ObjectConverter returns "null". But org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(Class, Exchange, Object) interpret this "null" as "suitable conversion not found" and cache misses. This lead to completely forgetting of conversion for given types.
      For example, when conversing Double to Long, all works until Double is NaN. After that, conversion for "Double-to-Long" marked as misses. And camel stop do any conversion for Double-to-Long until restart.

      Possible solution is to modify ObjectConverter`s methods to return "Void.TYPE" instead of "null" for NaN.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            ciand7 Andrey Utkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: