[ 
https://issues.apache.org/jira/browse/SOLR-7258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14365585#comment-14365585
 ] 

Hoss Man commented on SOLR-7258:
--------------------------------

the root issue is really that {{(static) MessageFormat.format}} and {{new 
MessageFormat(String)}} should be forbidden because they rely on the default 
locale.

as long as client code uses {{new MessageFormat(String,Locale)}} we should be 
fine.

> Add MessageFormat.format and MessageFormat no-arg constructor to 
> forbidden-apis
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-7258
>                 URL: https://issues.apache.org/jira/browse/SOLR-7258
>             Project: Solr
>          Issue Type: Task
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 5.1
>
>
> While tracing some TestBlobHandler failures with the thai locale I found that 
> the problem was MessageFormat.format which when given a Number ultimately 
> executes NumberFormat.getInstance(getLocale()).format(argument). In thai 
> locale, this transforms the digit 1 to a thai character and hence fails the 
> test.
> We should audit all usages of MessageFormat.format to see if any Number 
> objects are being passed as argument and wrap them with String.valueOf().
> Edit - Actually most format operations use the default locale so we should 
> just ban this API outright.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to