dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25604
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12753: Minor
------------------------------------------------------------
revno: 12753
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-16 21:25:28 +0200
message:
Minor
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/PartitionUtils.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/table/PartitionUtils.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/PartitionUtils.java 2013-10-16 19:21:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/PartitionUtils.java 2013-10-16 19:25:28 +0000
@@ -35,6 +35,7 @@
import java.util.List;
import java.util.Set;
+import org.apache.commons.lang.StringUtils;
import org.hisp.dhis.analytics.Partitions;
import org.hisp.dhis.common.ListMap;
import org.hisp.dhis.common.NameableObject;
@@ -70,18 +71,19 @@
public static Partitions getPartitions( Period period, String tablePrefix, String tableSuffix )
{
- String suffix = tableSuffix != null ? SEP + tableSuffix : "";
-
+ tablePrefix = StringUtils.trimToEmpty( tablePrefix );
+ tableSuffix = StringUtils.trimToEmpty( tableSuffix );
+
Partitions partitions = new Partitions();
Period startYear = PERIODTYPE.createPeriod( period.getStartDate() );
Period endYear = PERIODTYPE.createPeriod( period.getEndDate() );
- partitions.add( tablePrefix + SEP + startYear.getIsoDate() + suffix );
+ partitions.add( tablePrefix + SEP + startYear.getIsoDate() + tableSuffix );
if ( !startYear.equals( endYear ) )
{
- partitions.add( tablePrefix + SEP + endYear.getIsoDate() + suffix );
+ partitions.add( tablePrefix + SEP + endYear.getIsoDate() + tableSuffix );
}
return partitions;