[ 
https://issues.apache.org/jira/browse/SOLR-5885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexandre Rafalovitch resolved SOLR-5885.
-----------------------------------------
    Resolution: Won't Fix

> solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SimplePropertiesWriter.java
>  has crazy locale lookup
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-5885
>                 URL: https://issues.apache.org/jira/browse/SOLR-5885
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 4.7
>            Reporter: Uwe Schindler
>            Priority: Major
>             Fix For: 6.0, 4.9
>
>
> SimplePropertiesWriter uses the following code to convert a string to a 
> java.util.Locale:
> {code:java}
>     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;
>     }    
> {code}
> 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).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to