Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.8.1
-
CamelContext Spring configuration. Versions: Camel 2.8.1 / Spring 3.0.
-
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.