You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Owen Nichols (Jira)" <ji...@apache.org> on 2022/06/22 20:47:03 UTC

[jira] [Closed] (GEODE-9605) Using hard-coded character literals in Redis module is fine

     [ https://issues.apache.org/jira/browse/GEODE-9605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Owen Nichols closed GEODE-9605.
-------------------------------

> 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.20.7#820007)