← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18371: Analytics, compact code

 

------------------------------------------------------------
revno: 18371
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-02-22 19:31:40 +0100
message:
  Analytics, compact code
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-02-19 09:18:17 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-02-22 18:31:40 +0000
@@ -473,18 +473,11 @@
 
             metaData.put( NAMES_META_KEY, uidNameMap );
 
-            List<String> periodUids = new ArrayList<>();
-
             Calendar calendar = PeriodType.getCalendar();
 
-            if ( calendar.isIso8601() )
-            {
-                periodUids = getUids( params.getDimensionOrFilter( PERIOD_DIM_ID ) );
-            }
-            else
-            {
-                periodUids = getLocalPeriodIdentifiers( params.getDimensionOrFilter( PERIOD_DIM_ID ), calendar );
-            }
+            List<String> periodUids = calendar.isIso8601() ? 
+                getUids( params.getDimensionOrFilter( PERIOD_DIM_ID ) ) :
+                    getLocalPeriodIdentifiers( params.getDimensionOrFilter( PERIOD_DIM_ID ), calendar );
 
             metaData.put( PERIOD_DIM_ID, periodUids );
             metaData.put( ORGUNIT_DIM_ID, getUids( params.getDimensionOrFilter( ORGUNIT_DIM_ID ) ) );