← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18859: Analytics, minor simplification

 

------------------------------------------------------------
revno: 18859
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-04-09 20:17:08 +0200
message:
  Analytics, minor simplification
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-04-09 15:59:42 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-04-09 18:17:08 +0000
@@ -1295,20 +1295,13 @@
                 }
                 else
                 {
-                    if ( DisplayProperty.SHORTNAME.equals( displayProperty ) )
-                    {
-                        map.put( object.getUid(), object.getDisplayShortName() );
-                    }
-                    else // NAME
-                    {
-                        map.put( object.getUid(), object.getDisplayName() );
-                    }
+                    map.put( object.getUid(), NameableObjectUtils.getProperty( object, displayProperty ) );
                 }
 
                 if ( orgUnitHierarchy )
                 {
                     OrganisationUnit unit = (OrganisationUnit) object;
-
+                   
                     if ( DisplayProperty.SHORTNAME.equals( displayProperty ) )
                     {
                         map.putAll( NameableObjectUtils.getUidShortNameMap( unit.getAncestors() ) );
@@ -1324,7 +1317,7 @@
             {
                 map.put( dimension.getDimension(), dimension.getDisplayShortName() );
             }
-            else if ( dimension.getDisplayName() != null ) // NAME
+            else if ( dimension.getDisplayName() != null ) // NAME TODO use getProperty
             {
                 map.put( dimension.getDimension(), dimension.getDisplayName() );
             }