lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-7258) Forbid MessageFormat.format and MessageFormat single-arg constructor
Date Tue, 17 Mar 2015 23:18:38 GMT

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

Uwe Schindler commented on SOLR-7258:
-------------------------------------

Hi Shalin,
can you open an issue at forbidden-apis? It would be good to get the signatures into the unsafe
signatures there.
Thanks, Uwe

> Forbid MessageFormat.format and MessageFormat single-arg constructor
> --------------------------------------------------------------------
>
>                 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: Trunk, 5.1
>
>         Attachments: SOLR-7258.patch, SOLR-7258.patch
>
>
> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message