Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.4
-
None
-
None
-
None
Description
When passing an invalid locale string (len != 2 && len != 5 && len < 7) to org.apache.commons.lang3.LocaleUtils#toLocale(String) the method would previously (3.1) throw an IllegalArgumentException.
With version 3.4 the method will – at least for any string with len == 3 – create an arbitrary locale:
// GIVEN String localeString = "xyz"; // WHEN Locale xyz = LocaleUtils.toLocale(localeString); // THEN assertEquals(xyz.toString(), localeString); // What?
We are relying on this behaviour (IllegalArgumentException) and were quite surprised to not find any mention in the changelog.
Attachments
Issue Links
- is broken by
-
LANG-915 Wrong locale handling in LocaleUtils.toLocale()
- Closed