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

Tsuyoshi OZAWA commented on HADOOP-11602:
-----------------------------------------

I'd like to push current approach since I think it is more safe and 
straightforward.

As Akira mentioned, it's dangerous to use Locale.setDefault() as starting point 
of JVM for the backward compatibility. Especially, user programs may depend on 
their locale.

{quote}
So that if anybody needs to change it again it was a on line change rather than 
540 line change.
{quote}

I don't know whether utility method is better. The utility method doesn't 
reduce the LoC as Akira mentioned. In addition, I think that it's very rare to 
change all locale at the same time. 

BTW, I'll plan to add a rule, "to use toUpperCase/toLowerCase with 
Locale.ENGLISH" except special cases, to code review check list. We must check 
it at review time. https://wiki.apache.org/hadoop/CodeReviewChecklist




> Fix toUpperCase/toLowerCase to use Locale.ENGLISH
> -------------------------------------------------
>
>                 Key: HADOOP-11602
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11602
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Tsuyoshi OZAWA
>            Assignee: Tsuyoshi OZAWA
>         Attachments: HADOOP-11602-001.patch, HADOOP-11602-002.patch, 
> HADOOP-11602-branch-2.001.patch
>
>
> String#toLowerCase()/toUpperCase() without a locale argument can occur 
> unexpected behavior based on the locale. It's written in 
> [Javadoc|http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toLowerCase()]:
> {quote}
> For instance, "TITLE".toLowerCase() in a Turkish locale returns "t\u0131tle", 
> where '\u0131' is the LATIN SMALL LETTER DOTLESS I character
> {quote}
> This issue is derived from HADOOP-10101.



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

Reply via email to