You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/09/15 23:00:11 UTC
[jira] [Updated] (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 ]
ASF GitHub Bot updated GEODE-9605:
----------------------------------
Labels: pull-request-available (was: )
> 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
>
> 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)