commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Lucas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMAGING-117) SofnSegment.components - public mutable array
Date Wed, 23 Oct 2013 18:05:42 GMT

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

Gary Lucas commented on IMAGING-117:
------------------------------------

I recommend caution on this kind of change.  If we make a "safe copy" of an array every time
a get() method asks for one, we could end up making a lot of redundant copies of the same
thing.  This action would have a strongly negative impact on performance especially in image
processing where some of these calls are made (literally) millions of times.  

It is probably better to restrict the "safe copy" tactic to public methods only and just hope
that whoever writes code using protected methods is careful enough to not modify an array
he gets from the method.  

> SofnSegment.components - public mutable array
> ---------------------------------------------
>
>                 Key: IMAGING-117
>                 URL: https://issues.apache.org/jira/browse/IMAGING-117
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Sebb
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message