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

Tsz-wo Sze updated RATIS-1647:
------------------------------
    Attachment: 716_review.patch

> 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
>         Attachments: 716_review.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {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)

Reply via email to