Closed
Description
David Mas opened SPR-8099 and commented
The org.springframework.beans.propertyeditors.LocaleEditor is not giving the expected locale for some input formats.
I have created a test case with all the possible calls to Locale constructor.
Then, for each combination call the LocaleEditor with locale.toString().
The expected behaviour of the LocaleEditor would be to return the same testLocale as it received testLocale.toString(), but it does not.
The problem is with the StringUtils parseLocale method.
Attached the test case and a fix.
On the fix, the separator can be both a space and a underscore because the LocaleEditor states "Also accepts spaces as separators, as alternative to underscores"
Affects: 3.0.5
Attachments:
- LocaleEditor.java (723 bytes)
- LocaleEditorTest.java (2.43 kB)
Issue Links:
- StringUtils#parseLocaleString(String) does not work for empty locale [SPR-6562] #11228 StringUtils#parseLocaleString(String) does not work for empty locale
- StringUtils#parseLocaleString(String) with Variant when no Country [SPR-7598] #12254 StringUtils#parseLocaleString(String) with Variant when no Country ("is superseded by")
1 votes, 3 watchers