------------------------------------------------------------
revno: 17519
committer: Lars Helge Overland <[email protected]>
branch nick: dhis2
timestamp: Tue 2014-11-18 12:35:52 +0100
message:
  Immutable sort in operand
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2014-11-18 11:35:52 +0000
@@ -253,9 +253,11 @@
      */
     public Integer getRelevantAggregationLevel( int organisationUnitLevel )
     {
-        Collections.sort( aggregationLevels );
+        List<Integer> levels = new ArrayList<>( aggregationLevels );
+        
+        Collections.sort( levels );
 
-        for ( final Integer aggregationLevel : aggregationLevels )
+        for ( final Integer aggregationLevel : levels )
         {
             if ( aggregationLevel >= organisationUnitLevel )
             {

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to