You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/12/14 23:20:00 UTC

[jira] [Work logged] (IMAGING-151) ColorGroup.color_counts is mutable public List and is multiply sorted

     [ https://issues.apache.org/jira/browse/IMAGING-151?focusedWorklogId=359882&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-359882 ]

ASF GitHub Bot logged work on IMAGING-151:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Dec/19 23:19
            Start Date: 14/Dec/19 23:19
    Worklog Time Spent: 10m 
      Work Description: kinow commented on pull request #64: IMAGING-151: use a copy of the list, make members package-protected/private, and re-use Comparator
URL: https://github.com/apache/commons-imaging/pull/64
 
 
   This PR creates a `Comparator` for `ColorCount`, replacing two comparators created in different parts of the code with the same logic.
   
   The list that was sorted was a member of a class that could be used elsewhere. So instead of altering the values in that list, now other classes need to access that list through a method that returns a copy of the list.
   
   Members in the package-protected class were made package-protected (from public) or private.
   
   Bruno
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 359882)
    Remaining Estimate: 0h
            Time Spent: 10m

> ColorGroup.color_counts is mutable public List and is multiply sorted
> ---------------------------------------------------------------------
>
>                 Key: IMAGING-151
>                 URL: https://issues.apache.org/jira/browse/IMAGING-151
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> ColorGroup.color_counts is a public mutable List.
> Also the List is re-sorted in several places
> It looks like the field is only used within the package, so can be package protected.
> However it seems odd that the shared list is re-sorted by
> MedianCutLongestAxisImplementation.doCut
> and
> MedianCutMostPopulatedBoxesImplementation.performNextMedianCut (twice)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)