You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Swaminathan Balachandran (Jira)" <ji...@apache.org> on 2022/08/16 16:17:00 UTC

[jira] [Assigned] (RATIS-1647) Fix EI_EXPOSE_REP in DataStreamRequest implementations

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

Swaminathan Balachandran reassigned RATIS-1647:
-----------------------------------------------

    Assignee: Swaminathan Balachandran

> Fix EI_EXPOSE_REP in DataStreamRequest implementations
> ------------------------------------------------------
>
>                 Key: RATIS-1647
>                 URL: https://issues.apache.org/jira/browse/RATIS-1647
>             Project: Ratis
>          Issue Type: Sub-task
>          Components: Streaming
>            Reporter: Tsz-wo Sze
>            Assignee: Swaminathan Balachandran
>            Priority: Major
>
> {code}
> // DataStreamRequestByteBuffer
> // DataStreamRequestFilePositionCount
> // DataStreamRequestByteBuf
> // DataStreamRequestHeader
>   private WriteOption[] options;
> {code}
> The options field above currently is an array so that it causes [EI_EXPOSE_REP|https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#ei-may-expose-internal-representation-by-returning-reference-to-mutable-object-ei-expose-rep].
> The problem is that the getWriteOptions() method below in DataStreamRequest returns an array.  We probably should deprecate it and add a new method to return a List.
> {code}
>   //DataStreamRequest
>   WriteOption[] getWriteOptions();
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)