dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18318
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7676: Quickly fix.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 7676 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-23 19:02:12 +0200
message:
Quickly fix.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.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/period/RelativePeriods.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java 2012-07-23 16:26:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java 2012-07-23 17:00:59 +0000
@@ -348,27 +348,25 @@
* Gets the PeriodType with the highest frequency from a list of Periods.
*/
public PeriodType getHighestFrequencyPeriodType( List<Period> periods )
- {
+ {
+ PeriodType periodType = null;
+
if ( periods != null )
{
- PeriodType periodType = periods.get( 0 ).getPeriodType();
-
- int lowestFrequencyOrder = periodType.getFrequencyOrder();
+ PeriodType lowestFrequencyOrder = periods.get( 0 ).getPeriodType();
for ( Period period : periods )
{
- if ( period.getPeriodType().getFrequencyOrder() < lowestFrequencyOrder )
+ if ( period.getPeriodType().getFrequencyOrder() < lowestFrequencyOrder.getFrequencyOrder() )
{
- lowestFrequencyOrder = period.getPeriodType().getFrequencyOrder();
-
- periodType = period.getPeriodType();
+ lowestFrequencyOrder = period.getPeriodType();
}
}
- return periodType;
+ return lowestFrequencyOrder;
}
- return null;
+ return periodType;
}
/**