[jira] [Commented] (IMAGING-115) DhtSegment class contains mutable public arrays
[ 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
[ 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
[ 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)