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

initialDelay and idempotentRepository Endpoint URI parameters fail to be read from Camel context when Turkish language is set in host operating system.

    XMLWordPrintableJSON

Details

    • Patch Available
    • Unknown

    Description

      org.apache.camel.util.ObjectHelper.capitalize() method uses native JAVA String.toUpperCase() method (without parameters), which performs capitalization according to operating system current language and regional settings configuration. When these are set to Turkish, a call to capitalize() method, with a String starting with "i" as parameter, returns Turkish dotted "I" as capitalized "i", which is wrong according to programmatic language and expected behavior.

      This behaviour impacts, at least, in Endpoint URI parameters which names start with char "i", such as "idempotentRepository" and "initialDelay" URI parameters. When setter/getter methods lookup is performed for these parameters, wrong method names are returned due to ObjectHelper.capitalize() method. This method uses standard Java String.toUpperCase() function which returns a dotted "I" instead of dotless "I" for idempotentRepository and initialDelay parameters.

      To solve this, the attached patch consists of refactoring ObjectHelper.capitalize() method. Instead of calling toUpperCase() method, it is called toUpperCase(Locale.ENGLISH) to enforce 'I' character (dotless) return.

      Attachments

        1. ObjectHelper.java.patch
          0.8 kB
          Isidro Moreno
        2. TurkishCapitalizationTest.java
          1 kB
          Isidro Moreno

        Activity

          People

            davsclaus Claus Ibsen
            morenoisidro Isidro Moreno
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: