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.

    Details

    • Patch Info:
      Patch Available
    • Estimated Complexity:
      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.

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

        Activity

        Hide
        Isidro Moreno added a comment -

        Set Regional settings to Turkish before running the test.

        Operating System specific configuration:

        Windows 7: just Turkish regional settings (not necesary Windows display language) is enough to make the test fail.

        OSX 10.7.3: set Turkish as display language, not just regional settings.

        Show
        Isidro Moreno added a comment - Set Regional settings to Turkish before running the test. Operating System specific configuration: Windows 7: just Turkish regional settings (not necesary Windows display language) is enough to make the test fail. OSX 10.7.3: set Turkish as display language, not just regional settings.
        Hide
        Claus Ibsen added a comment -

        Thanks for reporting. Do you mind re-attaching your files and mark [x] in grant license to Apache. Otherwise we cannot accept and use your patches in the source.

        Show
        Claus Ibsen added a comment - Thanks for reporting. Do you mind re-attaching your files and mark [x] in grant license to Apache. Otherwise we cannot accept and use your patches in the source.
        Hide
        Isidro Moreno added a comment -

        Sorry, I've just re-attached the files. Thanks to you.

        Show
        Isidro Moreno added a comment - Sorry, I've just re-attached the files. Thanks to you.
        Hide
        Claus Ibsen added a comment -

        Thanks I have fixed all the toUpperCase and toLowerCase in camel-core to use the english locale.

        Show
        Claus Ibsen added a comment - Thanks I have fixed all the toUpperCase and toLowerCase in camel-core to use the english locale.

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Isidro Moreno
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development