[ 
https://issues.apache.org/jira/browse/BCEL-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14693744#comment-14693744
 ] 

Sebb commented on BCEL-238:
---------------------------

That would be OK by me, but is a bigger change.

Cloning the arrays is a simple fix, and Lists etc inherently use more memory.
In any case, any setters might need to clone the input list in order to protect 
it against subsequent external changes.

> Getters/setters for array should use clone
> ------------------------------------------
>
>                 Key: BCEL-238
>                 URL: https://issues.apache.org/jira/browse/BCEL-238
>             Project: Commons BCEL
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 6.0
>
>
> Further to BCEL-237, if a getter returns a reference to a private final 
> array, then the array contents can be corrupted. 
> Similarly if a setter stores an array reference without cloning it, then any 
> holders of the original reference can subsequently change the array entries.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to