Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
4.7
-
None
Description
SimplePropertiesWriter uses the following code to convert a string to a java.util.Locale:
if(params.get(LOCALE) != null) { String localeStr = params.get(LOCALE); for (Locale l : Locale.getAvailableLocales()) { if(localeStr.equals(l.getDisplayName(Locale.ROOT))) { locale = l; break; } } if(locale==null) { throw new DataImportHandlerException(SEVERE, "Unsupported locale for PropertWriter: " + localeStr); } } else { locale = Locale.ROOT; }
This makes no sense to me. Before I fixed that in LUCENE-5540, it was using the "localized" display name of the locale for lookup.
As we are on Java 7 in trunk and 4.x we can use the new API: Locale#forLanguageTag(String languageTag)
This one is not dependent on current locale, does not use display name and follows standards (IETF BCP 47).
Attachments
Issue Links
- is superceded by
-
SOLR-14783 Remove DIH from 9.0
- Closed