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

ASF subversion and git services commented on GEODE-9605:
--------------------------------------------------------

Commit 62f196b284f0939d5e3ce99a3689b4fa58148b9b in geode's branch 
refs/heads/develop from Donal Evans
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=62f196b ]

GEODE-9605: Remove unnecessary casts to byte (#6876)

Authored-by: Donal Evans <doev...@vmware.com>

> Using hard-coded character literals in Redis module is fine
> -----------------------------------------------------------
>
>                 Key: GEODE-9605
>                 URL: https://issues.apache.org/jira/browse/GEODE-9605
>             Project: Geode
>          Issue Type: Improvement
>          Components: redis
>    Affects Versions: 1.15.0
>            Reporter: Donal Evans
>            Assignee: Donal Evans
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.15.0
>
>
> A comment in the StringBytesGlossary class (formerly in the Coder class) 
> states:
> {noformat}
> /**
>  * Important note
>  * <p>
>  * Do not use '' <-- java primitive chars. Redis uses \{@link Coder#CHARSET} 
> encoding so we should
>  * not risk java handling char to byte conversions, rather just hard code 
> \{@link Coder#CHARSET}
>  * chars as bytes
>  */
> {noformat}
> which has led to many single-byte constants being introduced in the 
> StringBytesGlossary class for use in comparisons. However, since these 
> primitives are handled at compile time and the compiler always uses UTF-16, 
> there is no need to work around any platform-specific character set issues. 
> To simplify the code, the existing character constants should be inlined and 
> removed from the StringBytesGlossary class, along with the above comment.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to