dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38597
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19658: Removed CollectionUtils.emptyIfNull
------------------------------------------------------------
revno: 19658
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-07-15 21:25:25 +0200
message:
Removed CollectionUtils.emptyIfNull
modified:
dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.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-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java 2015-07-03 20:29:42 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java 2015-07-15 19:25:25 +0000
@@ -110,18 +110,6 @@
}
/**
- * Returns the Collection if it is not null or a new, empty Collection otherwise.
- *
- * @param collection the Collection.
- * @param <T> the type.
- * @return the given Collection or a new, empty Collection.
- */
- public static <T> Collection<T> emptyIfNull( Collection<T> collection )
- {
- return collection != null ? collection : new HashSet<T>();
- }
-
- /**
* Constructs a Map Entry (key, value). Used to construct a Map with asMap.
*
* @param key map entry key
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java 2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java 2015-07-15 19:25:25 +0000
@@ -28,24 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.common.ListMap;
-import org.hisp.dhis.dxf2.synch.SynchronizationManager;
-import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.scheduling.SchedulingManager;
-import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.system.scheduling.Scheduler;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_ALL;
import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_LAST_3_YEARS;
import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_YEAR;
@@ -63,7 +45,25 @@
import static org.hisp.dhis.system.scheduling.Scheduler.CRON_EVERY_15MIN;
import static org.hisp.dhis.system.scheduling.Scheduler.CRON_EVERY_MIN;
import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_RUNNING;
-import static org.hisp.dhis.commons.collection.CollectionUtils.emptyIfNull;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.common.ListMap;
+import org.hisp.dhis.dxf2.synch.SynchronizationManager;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.scheduling.SchedulingManager;
+import org.hisp.dhis.setting.SystemSettingManager;
+import org.hisp.dhis.system.scheduling.Scheduler;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
/**
* @author Lars Helge Overland
@@ -314,7 +314,7 @@
}
else
{
- Collection<String> keys = emptyIfNull( schedulingManager.getScheduledKeys() );
+ Collection<String> keys = schedulingManager.getScheduledKeys();
// -----------------------------------------------------------------
// Resource tables