Description
Kenan Sevindik opened SPR-13216 and commented
When the JVM's default locale is Turkish BeanPropertyRowMapper and deprecated ParameterizedBeanPropertyRowMapper as well, try to initialize themselves by obtaining PropertyDescriptors from given mappedClass, and then process given resultset within mapRow() method by trying to match database column names against identified mapped Fields.
However, PropertyDescriptor name and database column name lowercase conversions with toLowerCase() method cause problems when JVM default locale is Turkish. For example, a field such as item is expected to match with ITEM database column. However, due to column.replaceAll(" ", "").toLowerCase() call in mapRow() method column ITEM is converted into "ıtem" (i without dotted) and it won't match with "item" field. Similarly, "myItem" property is converted into "myıtem" within initialize() method, and it won't match against a database column name like "my_item" which is already lowercase.
Obvious solution for such Turkish character problems is to call toLowerCase() with Locale.US encoding.
Affects: 4.1.7
Issue Links:
- The BeanPropertyRowMapper does not work for field names ending with "numbers" which worked for 3.1 [SPR-16937] #21476 The BeanPropertyRowMapper does not work for field names ending with "numbers" which worked for 3.1
- BeanPropertyRowMapper should use ConversionService for date-time support [SPR-13888] #18461 BeanPropertyRowMapper should use ConversionService for date-time support
Referenced from: commits 41b5858