Details
Description
The Javadoc promises that the function will always return a valid Locale, at least a default.
This does not work if a String is provided which cannot be parsed to a valid locale through the parseLocale function which can return null.
public static Locale ensureLocale(Object localeObject) { if (localeObject instanceof String) { return parseLocale((String) localeObject); } else if (localeObject instanceof Locale) { return (Locale) localeObject; } return Locale.getDefault(); }
I will provide a patch for it.