[jira] [Commented] (IMAGING-115) DhtSegment class contains mutable public arrays

2013-10-22 Thread Sebb (JIRA)

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

Sebb commented on IMAGING-115:
--

In which case use a getter that does not copy.
At least it would be possible to have more control over thread-safety, and it 
would be possible to add debug tracing to accesses etc.

A public mutable field is bad.

> DhtSegment class contains mutable public arrays
> ---
>
> Key: IMAGING-115
> URL: https://issues.apache.org/jira/browse/IMAGING-115
> Project: Commons Imaging
>  Issue Type: Bug
>Reporter: Sebb
>
> Mutable public arrays are very bad for thread-safety and maintainability.



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


[jira] [Commented] (IMAGING-115) DhtSegment class contains mutable public arrays

2013-10-22 Thread Matt Benson (JIRA)

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

Matt Benson commented on IMAGING-115:
-

Maybe some alternate design should be explored whereby the arrays are 
maintained privately to classes whose methods use the arrays with parameters 
that have been passed in.

> DhtSegment class contains mutable public arrays
> ---
>
> Key: IMAGING-115
> URL: https://issues.apache.org/jira/browse/IMAGING-115
> Project: Commons Imaging
>  Issue Type: Bug
>Reporter: Sebb
>
> Mutable public arrays are very bad for thread-safety and maintainability.



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


[jira] [Commented] (IMAGING-115) DhtSegment class contains mutable public arrays

2013-10-22 Thread Damjan Jovanovic (JIRA)

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

Damjan Jovanovic commented on IMAGING-115:
--

DhtSegment fields are accessed from the performance-critical JPEG decompression 
path, so making those arrays private and returning copies in getters is 
probably out of the question.


> DhtSegment class contains mutable public arrays
> ---
>
> Key: IMAGING-115
> URL: https://issues.apache.org/jira/browse/IMAGING-115
> Project: Commons Imaging
>  Issue Type: Bug
>Reporter: Sebb
>
> Mutable public arrays are very bad for thread-safety and maintainability.



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