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

[jira] [Resolved] (GEODE-9450) StringBytesGlossary has a large number of MakeImmutable annotations

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

Dan Smith resolved GEODE-9450.
------------------------------
    Resolution: Won't Fix

Closing this issue because geode-for-redis was removed in GEODE-10278

> StringBytesGlossary has a large number of MakeImmutable annotations
> -------------------------------------------------------------------
>
>                 Key: GEODE-9450
>                 URL: https://issues.apache.org/jira/browse/GEODE-9450
>             Project: Geode
>          Issue Type: Improvement
>          Components: redis
>            Reporter: Darrel Schneider
>            Priority: Minor
>
> All of the byte array constants in StringBytesGlossary are annotated with MakeImmutable. This annotation indicates that changes need to be made.
> We could just change the annotation to Immutable but then we would still have static fields that could actually be mutated.
> In the case of StringBytesGlossary it seems like some of the byte array constants in it could be encapsulated into an Enum constant. The Enum constructor would take a byte array and store it the instance. But it would not have methods that allow other classes to get a reference to the byte array. Instead it could just have a "boolean equalsIgnoreCaseBytes(byte[])" and any other comparison methods needed and only those methods would need to be coded correctly to not modify the array. This would work fine for all the redis keywords we need to identify. Instead of passing a byte array to the constructor we could probably just use Enum.getName() in the constructor and call stringToBytes on it.
> But other constants in StringBytesGlossary are used for output to be sent back the the client (for example see bPING_RESPONSE). For those we probably should just mark the as Immutable.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)