You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Charles Honton (JIRA)" <ji...@apache.org> on 2015/08/12 17:31:46 UTC

[jira] [Commented] (BCEL-238) Getters/setters for array should use clone

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

Charles Honton commented on BCEL-238:
-------------------------------------

Should method contracts be changed to use Lists or Collections?

> 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)