You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2015/03/17 17:41:38 UTC

[jira] [Created] (SOLR-7258) Ensure no Numbers arguments are passed to MessageFormat.format in Lucene/Solr

Shalin Shekhar Mangar created SOLR-7258:
-------------------------------------------

             Summary: Ensure no Numbers arguments are passed to MessageFormat.format in Lucene/Solr
                 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().

I don't think forbidden-api can catch such problems. Perhaps we just forbid MessageFormat.format itself?



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

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