← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10979: Fixed wrong mergeWith method on BaseAnalyticalObject

 

------------------------------------------------------------
revno: 10979
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-05-24 13:03:32 +0200
message:
  Fixed wrong mergeWith method on BaseAnalyticalObject
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.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/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2013-05-23 16:57:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2013-05-24 11:03:32 +0000
@@ -465,43 +465,46 @@
         return StringUtils.join( ids, DIMENSION_SEP );
     }
     
-    public void mergeWith( BaseAnalyticalObject other )
+    @Override
+    public void mergeWith( IdentifiableObject other )
     {
         super.mergeWith( other );
         
         if ( other.getClass().isInstance( this ) )
-        {            
+        {
+            BaseAnalyticalObject object = (BaseAnalyticalObject) other;
+            
             indicators.clear();
-            indicators.addAll( other.getIndicators() );
+            indicators.addAll( object.getIndicators() );
 
             dataElements.clear();
-            dataElements.addAll( other.getDataElements() );
+            dataElements.addAll( object.getDataElements() );
 
             dataElementOperands.clear();
-            dataElementOperands.addAll( other.getDataElementOperands() );
+            dataElementOperands.addAll( object.getDataElementOperands() );
             
             dataSets.clear();
-            dataSets.addAll( other.getDataSets() );
+            dataSets.addAll( object.getDataSets() );
             
             periods.clear();
-            periods.addAll( other.getPeriods() );
+            periods.addAll( object.getPeriods() );
 
-            relatives = other.getRelatives() == null ? relatives : other.getRelatives();
+            relatives = object.getRelatives() == null ? relatives : object.getRelatives();
             
             organisationUnits.clear();
-            organisationUnits.addAll( other.getOrganisationUnits() );
+            organisationUnits.addAll( object.getOrganisationUnits() );
             
             dataElementGroups.clear();
-            dataElementGroups.addAll( other.getDataElementGroups() );
+            dataElementGroups.addAll( object.getDataElementGroups() );
             
             organisationUnitGroups.clear();
-            organisationUnitGroups.addAll( other.getOrganisationUnitGroups() );
+            organisationUnitGroups.addAll( object.getOrganisationUnitGroups() );
             
             categoryDimensions.clear();
-            categoryDimensions.addAll( other.getCategoryDimensions() );
+            categoryDimensions.addAll( object.getCategoryDimensions() );
             
-            userOrganisationUnit = other.isUserOrganisationUnit();
-            userOrganisationUnitChildren = other.isUserOrganisationUnitChildren();            
+            userOrganisationUnit = object.isUserOrganisationUnit();
+            userOrganisationUnitChildren = object.isUserOrganisationUnitChildren();            
         }
     }