hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-15889) String case conversions are locale-sensitive, used without locale
Date Sat, 28 May 2016 17:50:13 GMT

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

Sean Busbey commented on HBASE-15889:
-------------------------------------

yeah, those are pre-existing in the master branch. (maybe the phrasing on "hbase-rest in master
has X extant Foo" could use a reworking to make that clearer?) they don't show up in other
patches because most patches don't touch the hbase-rest module, so it doesn't get checked.

I pushed this to master. cherry-picking to branch-1 fails; would you mind putting up a branch-1
patch? (the name would be HBASE-15889-branch-1.v2.patch)

If you'd like to file another issue to take care of the findbugs stuff that'd be wonderful.

> String case conversions are locale-sensitive, used without locale
> -----------------------------------------------------------------
>
>                 Key: HBASE-15889
>                 URL: https://issues.apache.org/jira/browse/HBASE-15889
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Sean Mackrory
>            Assignee: Sean Mackrory
>            Priority: Minor
>         Attachments: HBASE-15889-v1.patch, HBASE-15891-v2.patch
>
>
> Static code analysis is flagging cases of String.toLowerCase and String.toUpperCase being
used without Locale. From the API reference:
> {quote}
> Note: This method is locale sensitive, and may produce unexpected results if used for
strings that are intended to be interpreted locale independently. Examples are programming
language identifiers, protocol keys, and HTML tags. For instance, "TITLE".toLowerCase() in
a Turkish locale returns "t\u0131tle", where '\u0131' is the LATIN SMALL LETTER DOTLESS I
character. To obtain correct results for locale insensitive strings, use toLowerCase(Locale.ROOT).
> {quote}
> Many uses of these functions do appear to be looking up classes, etc. and not dealing
with stored data, so I'd think there aren't significant compatibility problems here and specifying
the locale is indeed the safer way to go.



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

Mime
View raw message