← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5804: Removed custom comparators and replaced them with IdentifiableObjectNameComparator

 

------------------------------------------------------------
revno: 5804
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-01-25 18:11:43 +0100
message:
  Removed custom comparators and replaced them with IdentifiableObjectNameComparator
removed:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator/ChartNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator/ConceptNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator/ConstantNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator/DataDictionaryNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementAlternativeNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryComboNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionComboNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCodeComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupSetNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementShortNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetCodeComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetShortNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator/DocumentNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorAlternativeNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorCodeComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupSetNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorShortNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorTypeNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitCodeComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupSetNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitShortNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator/ReportComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator/ReportTableComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleGroupNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleNameComparator.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/DocumentContentProvider.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportTableContentProvider.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pivottable/impl/DefaultPivotTableService.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributesAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementCategoriesAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataSetsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupSetsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetValidationRulesAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/GetExpandedTreeAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetExpandedTreeAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/interceptor/OrganisationUnitTreeInterceptor.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/GetConstantListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/ActionSupport.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/zerovaluestorage/OpenDataElementsZeroIsSignificantManagerAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/GetDataDictionaryListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/GetAssignedGroupsByDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetAssignedIndicatorGroupsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowIndicatorGroupEditorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/DataElementGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/IndicatorGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/MobileDataSetListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/GetGroupSetListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ValidateGroupSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/GetOrganisationUnitDetailsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/SearchOrganisationUnitsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetGeneralSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetRoleAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupSetsAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupsAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorGroupsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GetDataSetReportOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/pivottable/action/GetPivotTableOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetAllTablesAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/SelectTallySheetAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/ViewTallySheetAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleListAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.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
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/comparator/AttributeNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.attribute.comparator;
-
-import java.util.Comparator;
-
-import org.hisp.dhis.attribute.Attribute;
-
-/**
- * @author mortenoh
- */
-public class AttributeNameComparator
-    implements Comparator<Attribute>
-{
-    @Override
-    public int compare( Attribute a0, Attribute a1 )
-    {
-        return a0.getName().compareToIgnoreCase( a1.getName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator/ChartNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator/ChartNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/comparator/ChartNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.chart.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.chart.Chart;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ChartNameComparator
-    implements Comparator<Chart>
-{
-    public int compare( Chart chart1, Chart chart2 )
-    {
-        return chart1.getName().compareToIgnoreCase( chart2.getName() );
-    }
-}

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java	2012-01-25 17:11:43 +0000
@@ -29,15 +29,17 @@
 
 import java.util.Comparator;
 
-import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.IdentifiableObject;
 
 /**
  * @author Lars Helge Overland
  */
 public class IdentifiableObjectNameComparator
-    implements Comparator<BaseIdentifiableObject>
+    implements Comparator<IdentifiableObject>
 {
-    public int compare( BaseIdentifiableObject object0, BaseIdentifiableObject object1 )
+    public static final Comparator<IdentifiableObject> INSTANCE = new IdentifiableObjectNameComparator();
+    
+    public int compare( IdentifiableObject object0, IdentifiableObject object1 )
     {
         return object0.getName().compareToIgnoreCase( object1.getName() );
     }

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator/ConceptNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator/ConceptNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/concept/comparator/ConceptNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.concept.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.concept.Concept;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class ConceptNameComparator
-    implements Comparator<Concept>
-{
-    public int compare( Concept concept0, Concept concept1 )
-    {
-        return concept0.getName().compareToIgnoreCase( concept1.getName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator/ConstantNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator/ConstantNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/constant/comparator/ConstantNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.constant.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.constant.Constant;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class ConstantNameComparator
-    implements Comparator<Constant>
-{
-    public int compare( Constant constant0, Constant constant1 )
-    {
-        return constant0.getName().compareToIgnoreCase( constant1.getName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator/DataDictionaryNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator/DataDictionaryNameComparator.java	2009-12-17 09:16:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datadictionary/comparator/DataDictionaryNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-package org.hisp.dhis.datadictionary.comparator;
-
-import java.util.Comparator;
-
-import org.hisp.dhis.datadictionary.DataDictionary;
-
-public class DataDictionaryNameComparator
-implements Comparator<DataDictionary>
-{
-    public int compare( DataDictionary dataDictionary0, DataDictionary dataDictionary1 )
-    {
-        return dataDictionary0.getName().compareToIgnoreCase( dataDictionary1.getName() );
-    }
-}
\ No newline at end of file

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2012-01-25 17:11:43 +0000
@@ -32,7 +32,7 @@
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.adapter.DataElementGroupXmlAdapter;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 
 import javax.xml.bind.annotation.*;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -147,7 +147,7 @@
     {
         List<DataElementGroup> sortedGroups = new ArrayList<DataElementGroup>( members );
 
-        Collections.sort( sortedGroups, new DataElementGroupNameComparator() );
+        Collections.sort( sortedGroups, new IdentifiableObjectNameComparator() );
 
         return sortedGroups;
     }

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementAlternativeNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementAlternativeNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementAlternativeNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElement;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataElementAlternativeNameComparator
-    implements Comparator<DataElement>
-{
-    public int compare( DataElement dataElement0, DataElement dataElement1 )
-    {
-        if ( dataElement0.getAlternativeName() == null )
-        {
-            return 1;
-        }
-        if ( dataElement1.getAlternativeName() == null )
-        {
-            return -1;
-        }        
-        
-        return dataElement0.getAlternativeName().compareToIgnoreCase( dataElement1.getAlternativeName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryComboNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryComboNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryComboNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataElementCategoryComboNameComparator
-    implements Comparator<DataElementCategoryCombo>
-{
-    public int compare( DataElementCategoryCombo categoryCombo1, DataElementCategoryCombo categoryCombo2 )
-    {
-        return categoryCombo1.getName().compareToIgnoreCase( categoryCombo2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementCategory;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataElementCategoryNameComparator
-    implements Comparator<DataElementCategory>
-{
-    public int compare( DataElementCategory category1, DataElementCategory category2 )
-    {
-        return category1.getName().compareToIgnoreCase( category2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionComboNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionComboNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionComboNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-
-/**
- * @author Chau Thu Tran
- * @version $Id$
- */
-public class DataElementCategoryOptionComboNameComparator
-    implements Comparator<DataElementCategoryOptionCombo>
-{
-    public int compare( DataElementCategoryOptionCombo categoryOptionCombo1, DataElementCategoryOptionCombo categoryOptionCombo2 )
-    {
-        return categoryOptionCombo1.getName().compareToIgnoreCase( categoryOptionCombo2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCategoryOptionNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementCategoryOption;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataElementCategoryOptionNameComparator
-    implements Comparator<DataElementCategoryOption>
-{
-    public int compare( DataElementCategoryOption categoryOption1, DataElementCategoryOption categoryOption2 )
-    {
-        return categoryOption1.getName().compareToIgnoreCase( categoryOption2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCodeComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCodeComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementCodeComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElement;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: DataElementCodeComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class DataElementCodeComparator
-    implements Comparator<DataElement>
-{
-    public int compare( DataElement dataElement0, DataElement dataElement1 )
-    {
-        if ( dataElement0.getCode() == null )
-        {
-            return 1;
-        }
-        if ( dataElement1.getCode() == null )
-        {
-            return -1;
-        }        
-        
-        return dataElement0.getCode().compareToIgnoreCase( dataElement1.getCode() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementGroup;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: DataElementGroupNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class DataElementGroupNameComparator
-    implements Comparator<DataElementGroup>
-{
-    public int compare( DataElementGroup dataElementGroup0, DataElementGroup dataElementGroup1 )
-    {
-        return dataElementGroup0.getName().compareToIgnoreCase( dataElementGroup1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupSetNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupSetNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementGroupSetNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElementGroupSet;
-
-/**
- * @author Tran Thanh Tri
- * @version $Id$
- */
-public class DataElementGroupSetNameComparator
-    implements Comparator<DataElementGroupSet>
-{
-    public int compare( DataElementGroupSet o1, DataElementGroupSet o2 )
-    {
-        return o1.getName().compareToIgnoreCase( o2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElement;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: DataElementNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class DataElementNameComparator
-    implements Comparator<DataElement>
-{
-    public int compare( DataElement dataElement0, DataElement dataElement1 )
-    {
-        return dataElement0.getName().compareToIgnoreCase( dataElement1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementShortNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementShortNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementShortNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.dataelement.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataelement.DataElement;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataElementShortNameComparator
-    implements Comparator<DataElement>
-{
-    public int compare( DataElement dataElement0, DataElement dataElement1 )
-    {
-        if ( dataElement0.getShortName() == null )
-        {
-            return 1;
-        }
-        if ( dataElement1.getShortName() == null )
-        {
-            return -1;
-        }
-        
-        return dataElement0.getShortName().compareToIgnoreCase( dataElement1.getShortName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetCodeComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetCodeComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetCodeComparator.java	1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-package org.hisp.dhis.dataset.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataset.DataSet;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataSetCodeComparator
-    implements Comparator<DataSet>
-{
-    public int compare( DataSet object0, DataSet object1 )
-    {
-        if ( object0 == null )
-        {
-            return 1;
-        }
-        
-        if ( object1 == null )
-        {
-            return -1;
-        }
-        
-        return object0.getCode().compareToIgnoreCase( object1.getCode() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.dataset.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataset.DataSet;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: DataSetNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class DataSetNameComparator
-    implements Comparator<DataSet>
-{
-    public int compare( DataSet dataSet0, DataSet dataSet1 )
-    {
-        return dataSet0.getName().compareToIgnoreCase( dataSet1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetShortNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetShortNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/comparator/DataSetShortNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-package org.hisp.dhis.dataset.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.dataset.DataSet;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DataSetShortNameComparator
-    implements Comparator<DataSet>
-{
-    public int compare( DataSet object0, DataSet object1 )
-    {
-        if ( object0 == null )
-        {
-            return 1;
-        }
-        
-        if ( object1 == null )
-        {
-            return -1;
-        }
-        
-        return object0.getShortName().compareToIgnoreCase( object1.getShortName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator/DocumentNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator/DocumentNameComparator.java	2009-12-17 09:16:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/document/comparator/DocumentNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-package org.hisp.dhis.document.comparator;
-
-import java.util.Comparator;
-
-import org.hisp.dhis.document.Document;
-
-public class DocumentNameComparator
-    implements Comparator<Document>
-{
-    public int compare( Document object1, Document object2 )
-    {
-        return object1.getName().compareToIgnoreCase( object2.getName() );
-    }
-}

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2012-01-25 17:11:43 +0000
@@ -27,19 +27,24 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.adapter.IndicatorGroupXmlAdapter;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
-
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 
 /**
  * An IndicatorGroupSet is a set of IndicatorGroups. It is by default exclusive,
@@ -141,7 +146,7 @@
     {
         List<IndicatorGroup> sortedGroups = new ArrayList<IndicatorGroup>( members );
 
-        Collections.sort( sortedGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( sortedGroups, new IdentifiableObjectNameComparator() );
 
         return sortedGroups;
     }

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorAlternativeNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorAlternativeNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorAlternativeNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.Indicator;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class IndicatorAlternativeNameComparator
-    implements Comparator<Indicator>
-{
-    public int compare( Indicator indicator0, Indicator indicator1 )
-    {
-        if ( indicator0.getAlternativeName() == null )
-        {
-            return 1;
-        }
-        if ( indicator1.getAlternativeName() == null )
-        {
-            return -1;
-        }
-        
-        return indicator0.getAlternativeName().compareToIgnoreCase( indicator1.getAlternativeName() );
-    }    
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorCodeComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorCodeComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorCodeComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.Indicator;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: IndicatorCodeComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class IndicatorCodeComparator
-    implements Comparator<Indicator>
-{
-    public int compare( Indicator indicator0, Indicator indicator1 )
-    {
-        if ( indicator0.getCode() == null )
-        {
-            return 1;
-        }
-        if ( indicator1.getCode() == null )
-        {
-            return -1;
-        }
-        
-        return indicator0.getCode().compareToIgnoreCase( indicator1.getCode() );
-    }    
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.IndicatorGroup;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: IndicatorGroupNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class IndicatorGroupNameComparator
-    implements Comparator<IndicatorGroup>
-{
-    public int compare( IndicatorGroup indicatorGroup0, IndicatorGroup indicatorGroup1 )
-    {
-        return indicatorGroup0.getName().compareToIgnoreCase( indicatorGroup1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupSetNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupSetNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorGroupSetNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.IndicatorGroupSet;
-
-/**
- * @author Tran Thanh Tri
- * @version $Id$
- */
-public class IndicatorGroupSetNameComparator
-    implements Comparator<IndicatorGroupSet>
-{
-
-    public int compare( IndicatorGroupSet o1, IndicatorGroupSet o2 )
-    {        
-        return o1.getName().compareToIgnoreCase( o2.getName() );
-    }
-
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.Indicator;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: IndicatorNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class IndicatorNameComparator
-    implements Comparator<Indicator>
-{
-    public int compare( Indicator indicator0, Indicator indicator1 )
-    {
-        return indicator0.getName().compareToIgnoreCase( indicator1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorShortNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorShortNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorShortNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.Indicator;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class IndicatorShortNameComparator
-    implements Comparator<Indicator>
-{
-    public int compare( Indicator indicator0, Indicator indicator1 )
-    {
-        if ( indicator0.getShortName() == null )
-        {
-            return 1;
-        }
-        if ( indicator1.getShortName() == null )
-        {
-            return -1;
-        }
-        
-        return indicator0.getShortName().compareToIgnoreCase( indicator1.getShortName() );        
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorTypeNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorTypeNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorTypeNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.indicator.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.indicator.IndicatorType;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: IndicatorTypeNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class IndicatorTypeNameComparator
-    implements Comparator<IndicatorType>
-{
-    public int compare( IndicatorType indicatorType0, IndicatorType indicatorType1 )
-    {
-        return indicatorType0.getName().compareToIgnoreCase( indicatorType1.getName() );
-    }
-}

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-01-25 17:11:43 +0000
@@ -27,6 +27,24 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
@@ -34,20 +52,15 @@
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.BaseNameableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
+import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.adapter.DataSetXmlAdapter;
 import org.hisp.dhis.common.adapter.OrganisationUnitGroupXmlAdapter;
 import org.hisp.dhis.common.adapter.OrganisationUnitXmlAdapter;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.user.User;
 
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * @author Kristian Nordal
  */
@@ -65,7 +78,7 @@
 
     private static final List<String> FEATURETYPES = Arrays.asList( FEATURETYPE_NONE, FEATURETYPE_MULTIPOLYGON, FEATURETYPE_POLYGON, FEATURETYPE_POINT );
     
-    private static final Comparator<OrganisationUnit> COMPARATOR = new OrganisationUnitNameComparator();
+    private static final Comparator<IdentifiableObject> COMPARATOR = new IdentifiableObjectNameComparator();
 
     private static final Pattern JSON_COORDINATE_PATTERN = Pattern.compile( "(\\[{3}.*?\\]{3})" );
     private static final Pattern COORDINATE_PATTERN = Pattern.compile( "([\\-0-9.]+,[\\-0-9.]+)" );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2012-01-25 17:11:43 +0000
@@ -27,16 +27,28 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
+import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.adapter.OrganisationUnitGroupXmlAdapter;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
-
-import javax.xml.bind.annotation.*;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.*;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 
 /**
  * @author Kristian Nordal
@@ -50,7 +62,7 @@
      */
     private static final long serialVersionUID = -221220579471558683L;
 
-    private static final Comparator<OrganisationUnitGroup> COMPARATOR = new OrganisationUnitGroupNameComparator();
+    private static final Comparator<IdentifiableObject> COMPARATOR = new IdentifiableObjectNameComparator();
 
     private Set<OrganisationUnitGroup> organisationUnitGroups = new HashSet<OrganisationUnitGroup>();
 

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitCodeComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitCodeComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitCodeComparator.java	1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-package org.hisp.dhis.organisationunit.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class OrganisationUnitCodeComparator
-    implements Comparator<OrganisationUnit>
-{
-    public int compare( OrganisationUnit organisationUnit0, OrganisationUnit organisationUnit1 )
-    {
-        if ( organisationUnit0.getCode() == null )
-        {
-            return 1;
-        }
-        if ( organisationUnit1.getCode() == null )
-        {
-            return -1;
-        }
-        
-        return organisationUnit0.getCode().compareToIgnoreCase( organisationUnit1.getCode() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.organisationunit.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
-
-import java.util.Comparator;
-
-/**
- * @author Kristian Nordal
- * @version $Id: OrganisationUnitGroupNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class OrganisationUnitGroupNameComparator
-    implements Comparator<OrganisationUnitGroup>
-{
-    public int compare( OrganisationUnitGroup organisationUnitGroup0, OrganisationUnitGroup organisationUnitGroup1 )
-    {
-        return organisationUnitGroup0.getName().compareToIgnoreCase( organisationUnitGroup1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupSetNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupSetNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitGroupSetNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.organisationunit.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class OrganisationUnitGroupSetNameComparator
-    implements Comparator<OrganisationUnitGroupSet>
-{
-    public int compare( OrganisationUnitGroupSet groupSet0, OrganisationUnitGroupSet groupSet1 )
-    {
-        return groupSet0.getName().compareToIgnoreCase( groupSet1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.organisationunit.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: OrganisationUnitNameComparator.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class OrganisationUnitNameComparator
-    implements Comparator<OrganisationUnit>
-{
-    public int compare( OrganisationUnit organisationUnit0, OrganisationUnit organisationUnit1 )
-    {
-        return organisationUnit0.getName().compareToIgnoreCase( organisationUnit1.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitShortNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitShortNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/comparator/OrganisationUnitShortNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.organisationunit.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class OrganisationUnitShortNameComparator
-    implements Comparator<OrganisationUnit>
-{
-    public int compare( OrganisationUnit organisationUnit0, OrganisationUnit organisationUnit1 )
-    {
-        return organisationUnit0.getShortName().compareToIgnoreCase( organisationUnit1.getShortName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator/ReportComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator/ReportComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/comparator/ReportComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.report.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.report.Report;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ReportComparator
-    implements Comparator<Report>
-{
-    public int compare( Report report1, Report report2 )
-    {
-        return report1.getName().compareTo( report2.getName() );
-    }
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator/ReportTableComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator/ReportTableComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/comparator/ReportTableComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.reporttable.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.reporttable.ReportTable;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ReportTableComparator
-    implements Comparator<ReportTable>
-{
-    public int compare( ReportTable table1, ReportTable table2 )
-    {
-        return table1.getName().compareToIgnoreCase( table2.getName() );
-    }    
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleGroupNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleGroupNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleGroupNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.validation.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.validation.ValidationRuleGroup;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ValidationRuleGroupNameComparator
-    implements Comparator<ValidationRuleGroup>
-{
-    public int compare( ValidationRuleGroup group1, ValidationRuleGroup group2 )
-    {
-        return group1.getName().compareToIgnoreCase( group2.getName() );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/comparator/ValidationRuleNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.validation.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.validation.ValidationRule;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ValidationRuleNameComparator
-    implements Comparator<ValidationRule>
-{
-    public int compare( ValidationRule rule1, ValidationRule rule2 )
-    {
-        return rule1.getName().compareToIgnoreCase( rule2.getName() );
-    }
-}

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2012-01-25 17:11:43 +0000
@@ -39,11 +39,11 @@
 import java.util.TreeMap;
 
 import org.apache.commons.collections.CollectionUtils;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
@@ -53,20 +53,17 @@
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.system.filter.OrganisationUnitGroupWithoutGroupSetFilter;
 import org.hisp.dhis.system.util.Filter;
 import org.hisp.dhis.system.util.FilterUtils;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -79,11 +76,7 @@
     implements DataIntegrityService
 {
     private static final String FORMULA_SEPARATOR = "#";
-    private static final Comparator<DataElement> DATAELEMENT_COMPARATOR = new DataElementNameComparator();
-    private static final Comparator<Indicator> INDICATOR_COMPARATOR = new IndicatorNameComparator();
-    private static final Comparator<OrganisationUnit> ORGANISATIONUNIT_COMPARATOR = new OrganisationUnitNameComparator();
-    private static final Comparator<ValidationRule> VALIDATIONRULE_COMPARATOR = new ValidationRuleNameComparator();
-
+    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -168,7 +161,7 @@
 
         Collection<DataSet> dataSets = dataSetService.getAllDataSets();
 
-        SortedMap<DataElement, Collection<DataSet>> targets = new TreeMap<DataElement, Collection<DataSet>>( DATAELEMENT_COMPARATOR );
+        SortedMap<DataElement, Collection<DataSet>> targets = new TreeMap<DataElement, Collection<DataSet>>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( DataElement element : dataElements )
         {
@@ -198,12 +191,18 @@
     {
         Collection<DataElementGroupSet> groupSets = dataElementService.getAllDataElementGroupSets();
 
-        SortedMap<DataElement, Collection<DataElementGroup>> targets = new TreeMap<DataElement, Collection<DataElementGroup>>( DATAELEMENT_COMPARATOR );
+        SortedMap<DataElement, Collection<DataElementGroup>> targets = new TreeMap<DataElement, Collection<DataElementGroup>>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( DataElementGroupSet groupSet : groupSets )
         {
-            Collection<DataElement> duplicates = getDuplicates( 
-                new ArrayList<DataElement>( groupSet.getDataElements() ), DATAELEMENT_COMPARATOR );
+            Collection<DataElement> duplicates = getDuplicates(  
+                new ArrayList<DataElement>( groupSet.getDataElements() ), new Comparator<DataElement>()
+                {
+                    public int compare( DataElement d1, DataElement d2 )
+                    {
+                        return d1.getName().compareTo( d2.getName() );
+                    }                    
+                } );
             
             for ( DataElement duplicate : duplicates )
             {
@@ -299,7 +298,7 @@
 
     public SortedMap<Indicator, String> getInvalidIndicatorNumerators()
     {
-        SortedMap<Indicator, String> invalids = new TreeMap<Indicator, String>( INDICATOR_COMPARATOR );
+        SortedMap<Indicator, String> invalids = new TreeMap<Indicator, String>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( Indicator indicator : indicatorService.getAllIndicators() )
         {
@@ -316,7 +315,7 @@
 
     public SortedMap<Indicator, String> getInvalidIndicatorDenominators()
     {
-        SortedMap<Indicator, String> invalids = new TreeMap<Indicator, String>( INDICATOR_COMPARATOR );
+        SortedMap<Indicator, String> invalids = new TreeMap<Indicator, String>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( Indicator indicator : indicatorService.getAllIndicators() )
         {
@@ -336,12 +335,18 @@
     {
         Collection<IndicatorGroupSet> groupSets = indicatorService.getAllIndicatorGroupSets();
 
-        SortedMap<Indicator, Collection<IndicatorGroup>> targets = new TreeMap<Indicator, Collection<IndicatorGroup>>( INDICATOR_COMPARATOR );
+        SortedMap<Indicator, Collection<IndicatorGroup>> targets = new TreeMap<Indicator, Collection<IndicatorGroup>>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( IndicatorGroupSet groupSet : groupSets )
         {
             Collection<Indicator> duplicates = getDuplicates( 
-                new ArrayList<Indicator>( groupSet.getIndicators() ), INDICATOR_COMPARATOR );
+                new ArrayList<Indicator>( groupSet.getIndicators() ), new Comparator<Indicator>()
+                {
+                    public int compare( Indicator o1, Indicator o2 )
+                    {
+                        return o1.getName().compareTo( o2.getName() );
+                    }
+                } );
             
             for ( Indicator duplicate : duplicates )
             {
@@ -440,12 +445,18 @@
         Collection<OrganisationUnitGroupSet> groupSets = organisationUnitGroupService.getAllOrganisationUnitGroupSets();
 
         TreeMap<OrganisationUnit, Collection<OrganisationUnitGroup>> targets = 
-            new TreeMap<OrganisationUnit, Collection<OrganisationUnitGroup>>( ORGANISATIONUNIT_COMPARATOR );
+            new TreeMap<OrganisationUnit, Collection<OrganisationUnitGroup>>( IdentifiableObjectNameComparator.INSTANCE );
 
         for ( OrganisationUnitGroupSet groupSet : groupSets )
         {
             Collection<OrganisationUnit> duplicates = getDuplicates( 
-                new ArrayList<OrganisationUnit>( groupSet.getOrganisationUnits() ), ORGANISATIONUNIT_COMPARATOR );
+                new ArrayList<OrganisationUnit>( groupSet.getOrganisationUnits() ), new Comparator<OrganisationUnit>()
+                {
+                    public int compare( OrganisationUnit o1, OrganisationUnit o2 )
+                    {
+                        return o1.getName().compareTo( o2.getName() );
+                    }                    
+                } );
             
             for ( OrganisationUnit duplicate : duplicates )
             {
@@ -483,7 +494,7 @@
     public SortedMap<ValidationRule, String> getInvalidValidationRuleLeftSideExpressions()
     {
         SortedMap<ValidationRule, String> invalids = new TreeMap<ValidationRule, String>(
-            VALIDATIONRULE_COMPARATOR );
+            IdentifiableObjectNameComparator.INSTANCE );
 
         for ( ValidationRule rule : validationRuleService.getAllValidationRules() )
         {
@@ -501,7 +512,7 @@
     public SortedMap<ValidationRule, String> getInvalidValidationRuleRightSideExpressions()
     {
         SortedMap<ValidationRule, String> invalids = new TreeMap<ValidationRule, String>(
-            VALIDATIONRULE_COMPARATOR );
+            IdentifiableObjectNameComparator.INSTANCE );
 
         for ( ValidationRule rule : validationRuleService.getAllValidationRules() )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2012-01-25 17:11:43 +0000
@@ -36,6 +36,7 @@
 
 import org.amplecode.quick.BatchHandler;
 import org.amplecode.quick.BatchHandlerFactory;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
@@ -44,23 +45,16 @@
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupSetNameComparator;
-import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.jdbc.batchhandler.GenericBatchHandler;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.resourcetable.statement.CreateCategoryTableStatement;
 import org.hisp.dhis.resourcetable.statement.CreateDataElementGroupSetTableStatement;
@@ -213,11 +207,11 @@
 
         List<DataElement> dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
         
-        Collections.sort( dataElements, new DataElementNameComparator() );
+        Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
         
         List<DataElementGroupSet> groupSets = new ArrayList<DataElementGroupSet>( dataElementService.getAllDataElementGroupSets() );
         
-        Collections.sort( groupSets, new DataElementGroupSetNameComparator() );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         
         resourceTableStore.createDataElementGroupSetStructure( groupSets );
 
@@ -260,11 +254,11 @@
 
         List<Indicator> indicators = new ArrayList<Indicator>( indicatorService.getAllIndicators() );
         
-        Collections.sort( indicators, new IndicatorNameComparator() );
+        Collections.sort( indicators, IdentifiableObjectNameComparator.INSTANCE );
         
         List<IndicatorGroupSet> groupSets = new ArrayList<IndicatorGroupSet>( indicatorService.getAllIndicatorGroupSets() );
         
-        Collections.sort( groupSets, new IndicatorGroupSetNameComparator() );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         
         resourceTableStore.createIndicatorGroupSetStructure( groupSets );
 
@@ -308,12 +302,12 @@
         List<OrganisationUnit> units = new ArrayList<OrganisationUnit>( organisationUnitService
             .getAllOrganisationUnits() );
 
-        Collections.sort( units, new OrganisationUnitNameComparator() );
+        Collections.sort( units, IdentifiableObjectNameComparator.INSTANCE );
 
         List<OrganisationUnitGroupSet> groupSets = new ArrayList<OrganisationUnitGroupSet>(
             organisationUnitGroupService.getAllOrganisationUnitGroupSets() );
 
-        Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         resourceTableStore.createOrganisationUnitGroupSetStructure( groupSets );
 
@@ -356,7 +350,7 @@
 
         List<DataElementCategory> categories = new ArrayList<DataElementCategory>( categoryService.getAllDataElementCategories() );
         
-        Collections.sort( categories, new DataElementCategoryNameComparator() );
+        Collections.sort( categories, IdentifiableObjectNameComparator.INSTANCE );
         
         List<DataElementCategoryOptionCombo> categoryOptionCombos = 
             new ArrayList<DataElementCategoryOptionCombo>( categoryService.getAllDataElementCategoryOptionCombos() );

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
@@ -79,7 +79,7 @@
             elements = new ArrayList<DataElement>( params.getDataElementObjects() );
         }
         
-        Collections.sort( elements, new DataElementNameComparator() );
+        Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
         
         PDFUtils.printObjectFrontPage( document, elements, i18n, format, "data_elements" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java	2012-01-25 17:11:43 +0000
@@ -31,6 +31,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -38,7 +39,6 @@
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.system.util.PDFUtils;
 
 import com.lowagie.text.Document;
@@ -82,7 +82,7 @@
             elements = new ArrayList<Indicator>( params.getIndicatorObjects() );
         }
 
-        Collections.sort( elements, new IndicatorNameComparator() );
+        Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
 
         PDFUtils.printObjectFrontPage( document, elements, i18n, format, "indicators" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java	2012-01-25 17:11:43 +0000
@@ -31,13 +31,13 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.system.util.PDFUtils;
 
 import com.lowagie.text.Document;
@@ -83,7 +83,7 @@
             elements = new ArrayList<OrganisationUnit>( params.getOrganisationUnitObjects() );
         }
 
-        Collections.sort( elements, new OrganisationUnitNameComparator() );
+        Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
         
         PDFUtils.printObjectFrontPage( document, elements, i18n, format, "organisation_units" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java	2011-10-17 08:11:42 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java	2012-01-25 17:11:43 +0000
@@ -31,6 +31,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -39,7 +40,6 @@
 import org.hisp.dhis.system.util.PDFUtils;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.lowagie.text.Document;
 
@@ -84,7 +84,7 @@
             elements = new ArrayList<ValidationRule>( params.getValidationRuleObjects() );
         }
 
-        Collections.sort( elements, new ValidationRuleNameComparator() );
+        Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
 
         PDFUtils.printObjectFrontPage( document, elements, i18n, format, "validation_rules" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/DocumentContentProvider.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/DocumentContentProvider.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/DocumentContentProvider.java	2012-01-25 17:11:43 +0000
@@ -32,10 +32,10 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
 import org.hisp.dhis.document.Document;
-import org.hisp.dhis.document.comparator.DocumentNameComparator;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 
@@ -87,7 +87,7 @@
             
             List<Document> documents = dashboardContent.getDocuments();
             
-            Collections.sort( documents, new DocumentNameComparator() );
+            Collections.sort( documents, IdentifiableObjectNameComparator.INSTANCE );
             
             content.put( key, documents );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportContentProvider.java	2012-01-25 17:11:43 +0000
@@ -32,10 +32,10 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
 import org.hisp.dhis.report.Report;
-import org.hisp.dhis.report.comparator.ReportComparator;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 
@@ -87,7 +87,7 @@
             
             List<Report> reports = dashboardContent.getReports();
             
-            Collections.sort( reports, new ReportComparator() );
+            Collections.sort( reports, IdentifiableObjectNameComparator.INSTANCE );
             
             content.put( key, reports );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportTableContentProvider.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportTableContentProvider.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/ReportTableContentProvider.java	2012-01-25 17:11:43 +0000
@@ -32,10 +32,10 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
 import org.hisp.dhis.reporttable.ReportTable;
-import org.hisp.dhis.reporttable.comparator.ReportTableComparator;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 
@@ -91,7 +91,7 @@
             
             List<ReportTable> reportTables = dashboardContent.getReportTables();
             
-            Collections.sort( reportTables, new ReportTableComparator() );
+            Collections.sort( reportTables, IdentifiableObjectNameComparator.INSTANCE );
             
             content.put( key, reportTables );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java	2012-01-19 12:19:18 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java	2012-01-25 17:11:43 +0000
@@ -27,7 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.dataentryform.DataEntryFormService.*;
+import static org.hisp.dhis.dataentryform.DataEntryFormService.DATAELEMENT_TOTAL_PATTERN;
+import static org.hisp.dhis.dataentryform.DataEntryFormService.IDENTIFIER_PATTERN;
 import static org.hisp.dhis.dataentryform.DataEntryFormService.INDICATOR_PATTERN;
 import static org.hisp.dhis.dataentryform.DataEntryFormService.INPUT_PATTERN;
 import static org.hisp.dhis.options.SystemSettingManager.AGGREGATION_STRATEGY_REAL_TIME;
@@ -48,12 +49,11 @@
 import org.hisp.dhis.aggregation.AggregationService;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOption;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryOptionComboNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataentryform.DataEntryForm;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.Section;
@@ -243,7 +243,7 @@
     {
         List<DataElement> dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
 
-        Collections.sort( dataElements, new DataElementNameComparator() );
+        Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
         FilterUtils.filter( dataElements, new AggregatableDataElementFilter() );
 
         String aggregationStrategy = (String) systemSettingManager.getSystemSetting( KEY_AGGREGATION_STRATEGY,
@@ -263,7 +263,7 @@
         List<DataElementCategoryOptionCombo> orderedOptionCombos = new ArrayList<DataElementCategoryOptionCombo>(
             optionCombos );
 
-        Collections.sort( orderedOptionCombos, new DataElementCategoryOptionComboNameComparator() );
+        Collections.sort( orderedOptionCombos, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Create a grid

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java	2012-01-13 10:12:43 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java	2012-01-25 17:11:43 +0000
@@ -31,7 +31,6 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,12 +39,11 @@
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.orgunitdistribution.OrgUnitDistributionService;
 import org.hisp.dhis.system.grid.ListGrid;
 import org.jfree.chart.JFreeChart;
@@ -60,9 +58,6 @@
 public class DefaultOrgUnitDistributionService
     implements OrgUnitDistributionService
 {
-    private static final Comparator<OrganisationUnit> ORGUNIT_COMPARATOR = new OrganisationUnitNameComparator();
-    private static final Comparator<OrganisationUnitGroup> ORGUNIT_GROUP_COMPARATOR = new OrganisationUnitGroupNameComparator();
-
     private static final String TITLE_SEP = " - ";
     private static final String FIRST_COLUMN_TEXT = "Organisation unit";
     private static final String HEADER_NONE = "None";
@@ -121,8 +116,8 @@
         List<OrganisationUnit> units = organisationUnitOnly ? Arrays.asList( organisationUnit ) : new ArrayList<OrganisationUnit>( organisationUnit.getChildren() );
         List<OrganisationUnitGroup> groups = new ArrayList<OrganisationUnitGroup>( groupSet.getOrganisationUnitGroups() );
         
-        Collections.sort( units, ORGUNIT_COMPARATOR );
-        Collections.sort( groups, ORGUNIT_GROUP_COMPARATOR );
+        Collections.sort( units, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groups, IdentifiableObjectNameComparator.INSTANCE );
         
         if ( !organisationUnitOnly )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pivottable/impl/DefaultPivotTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pivottable/impl/DefaultPivotTableService.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pivottable/impl/DefaultPivotTableService.java	2012-01-25 17:11:43 +0000
@@ -49,7 +49,6 @@
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
@@ -66,8 +65,6 @@
 public class DefaultPivotTableService
     implements PivotTableService
 {
-    private static final Comparator<BaseIdentifiableObject> INDICATOR_COMPARATOR = new IdentifiableObjectNameComparator();
-    private static final Comparator<OrganisationUnit> ORGUNIT_COMPARATOR = new OrganisationUnitNameComparator();
     private static final Comparator<Period> PERIOD_COMPARATOR = new AscendingPeriodComparator();
     
     // -------------------------------------------------------------------------
@@ -178,8 +175,8 @@
         pivotTable.setOrganisationUnits( organisationUnits );
         pivotTable.setIndicatorValues( aggregatedValues );
         
-        Collections.sort( pivotTable.getIndicators(), INDICATOR_COMPARATOR );
-        Collections.sort( pivotTable.getOrganisationUnits(), ORGUNIT_COMPARATOR );
+        Collections.sort( pivotTable.getIndicators(), IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( pivotTable.getOrganisationUnits(), IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( pivotTable.getPeriods(), PERIOD_COMPARATOR );
         
         return pivotTable;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2012-01-25 17:11:43 +0000
@@ -66,7 +66,7 @@
         
         return false;
     }
-
+    
     /**
      * Returns the duplicates in the given list. List entries are compared
      * using the given comparator.

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java	2012-01-25 17:11:43 +0000
@@ -32,9 +32,9 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -83,7 +83,7 @@
                 dataSetListIterator.remove();
         }
 
-        Collections.sort( datasets, new DataSetNameComparator() );
+        Collections.sort( datasets, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java	2012-01-25 17:11:43 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
 import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
 import org.hisp.dhis.caseentry.state.PeriodGenericManager;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataset.DataSet;
@@ -46,8 +47,6 @@
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.period.CalendarPeriodType;
 import org.hisp.dhis.period.Period;
@@ -182,7 +181,7 @@
         {
             orgUnitList.add( selectedOrgunit );
             List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>( selectedOrgunit.getChildren() );
-            Collections.sort( organisationUnits, new OrganisationUnitShortNameComparator() );
+            Collections.sort( organisationUnits, IdentifiableObjectNameComparator.INSTANCE );
             orgUnitList.addAll( organisationUnits );
         }
         else
@@ -299,7 +298,7 @@
         orgUnitTree.add( orgUnit );
 
         List<OrganisationUnit> children = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
-        Collections.sort( children, new OrganisationUnitNameComparator() );
+        Collections.sort( children, IdentifiableObjectNameComparator.INSTANCE );
 
         for ( OrganisationUnit child : children )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributesAction.java	2011-09-08 10:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAttributesAction.java	2012-01-25 17:11:43 +0000
@@ -33,7 +33,7 @@
 
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeNameComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -74,7 +74,7 @@
     {
         attributes = new ArrayList<Attribute>( attributeService.getAllAttributes() );
 
-        Collections.sort( attributes, new AttributeNameComparator() );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java	2011-10-31 12:46:53 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.constant.Constant;
 import org.hisp.dhis.constant.ConstantService;
-import org.hisp.dhis.constant.comparator.ConstantNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -45,10 +45,6 @@
 public class GetConstantsAction
     extends ActionPagingSupport<Constant>
 {
-    /**
-     * Determines if a de-serialized file is compatible with this class.
-     */
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -104,7 +100,7 @@
                 paging.getPageSize() ) );
         }
 
-        Collections.sort( constants, new ConstantNameComparator() );
+        Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementCategoriesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementCategoriesAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementCategoriesAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -74,7 +74,7 @@
         dataElementCategories = new ArrayList<DataElementCategory>(
             dataElementCategoryService.getAllDataElementCategories() );
 
-        Collections.sort( dataElementCategories, new DataElementCategoryNameComparator() );
+        Collections.sort( dataElementCategories, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupSetsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.util.IdentifiableObjectUtils;
 
@@ -86,7 +86,7 @@
             dataElementGroupSets = IdentifiableObjectUtils.filterNameByKey( dataElementGroupSets, key, true );
         }
 
-        Collections.sort( dataElementGroupSets, new DataElementGroupSetNameComparator() );
+        Collections.sort( dataElementGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.filter.DataElementGroupWithoutGroupSetFilter;
 import org.hisp.dhis.system.util.FilterUtils;
@@ -101,7 +101,7 @@
             dataElementGroups = IdentifiableObjectUtils.filterNameByKey( dataElementGroups, key, true );
         }
 
-        Collections.sort( this.dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( this.dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataSetsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataSetsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataSetsAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.List;
 import java.util.Set;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.user.CurrentUserService;
@@ -144,7 +144,7 @@
             dataSets.retainAll( ds );
         }
 
-        Collections.sort( dataSets, new DataSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.util.IdentifiableObjectUtils;
 
@@ -87,7 +87,7 @@
             indicatorGroupSets = IdentifiableObjectUtils.filterNameByKey( indicatorGroupSets, key, true );
         }
 
-        Collections.sort( indicatorGroupSets, new IndicatorGroupSetNameComparator() );
+        Collections.sort( indicatorGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.filter.IndicatorGroupWIthoutGroupSetFilter;
 import org.hisp.dhis.system.util.FilterUtils;
@@ -99,7 +99,7 @@
             indicatorGroups = IdentifiableObjectUtils.filterNameByKey( indicatorGroups, key, true );
         }
 
-        Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupSetsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupSetsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupSetsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.util.IdentifiableObjectUtils;
 
@@ -88,7 +88,7 @@
             organisationUnitGroupSets = IdentifiableObjectUtils.filterNameByKey( organisationUnitGroupSets, key, true );
         }
 
-        Collections.sort( organisationUnitGroupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( organisationUnitGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.filter.OrganisationUnitGroupWithoutGroupSetFilter;
 import org.hisp.dhis.system.util.FilterUtils;
@@ -103,7 +103,7 @@
             organisationUnitGroups = IdentifiableObjectUtils.filterNameByKey( organisationUnitGroups, key, true );
         }
 
-        Collections.sort( organisationUnitGroups, new OrganisationUnitGroupNameComparator() );
+        Collections.sort( organisationUnitGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         if ( usePaging )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java	2012-01-25 17:11:43 +0000
@@ -34,9 +34,9 @@
 import java.util.List;
 import java.util.UUID;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.version.Version;
@@ -152,7 +152,7 @@
             }
         }
         
-        Collections.sort( rootOrganisationUnits, new OrganisationUnitNameComparator() );
+        Collections.sort( rootOrganisationUnits, IdentifiableObjectNameComparator.INSTANCE );
         
         version = getVersionString();
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetValidationRulesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetValidationRulesAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetValidationRulesAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -73,7 +73,7 @@
     {
         validationRules = new ArrayList<ValidationRule>( validationRuleService.getAllValidationRules() );
 
-        Collections.sort( validationRules, new ValidationRuleNameComparator() );
+        Collections.sort( validationRules, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/GetExpandedTreeAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/GetExpandedTreeAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/GetExpandedTreeAction.java	2012-01-25 17:11:43 +0000
@@ -36,8 +36,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 
 import com.opensymphony.xwork2.Action;
@@ -102,7 +102,7 @@
         
         roots = new ArrayList<OrganisationUnit>( selectionTreeManager.getRootOrganisationUnits() );
 
-        Collections.sort( roots, new OrganisationUnitNameComparator() );
+        Collections.sort( roots, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Get the units that need to be expanded in order for the selected

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetExpandedTreeAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetExpandedTreeAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetExpandedTreeAction.java	2012-01-25 17:11:43 +0000
@@ -34,8 +34,8 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.ouwt.manager.TreeStateManager;
 
@@ -111,7 +111,7 @@
 
         roots = new ArrayList<OrganisationUnit>( selectionManager.getRootOrganisationUnits() );
 
-        Collections.sort( roots, new OrganisationUnitNameComparator() );
+        Collections.sort( roots, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Get the children of the roots

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/interceptor/OrganisationUnitTreeInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/interceptor/OrganisationUnitTreeInterceptor.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/interceptor/OrganisationUnitTreeInterceptor.java	2012-01-25 17:11:43 +0000
@@ -36,9 +36,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.interceptor.AbstractPreResultListener;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.ouwt.manager.TreeStateManager;
 
@@ -116,7 +116,7 @@
         throws Exception
     {
         List<OrganisationUnit> childUnitsSorted = new ArrayList<OrganisationUnit>( childUnits );
-        Collections.sort( childUnitsSorted, new OrganisationUnitNameComparator() );
+        Collections.sort( childUnitsSorted, IdentifiableObjectNameComparator.INSTANCE );
 
         List<TreeNode> childNodes = new ArrayList<TreeNode>();
 

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java	2012-01-25 05:35:10 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java	2012-01-25 17:11:43 +0000
@@ -38,7 +38,7 @@
 
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
-import org.hisp.dhis.chart.comparator.ChartNameComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dashboard.DashboardManager;
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.user.UserSettingService;
@@ -131,7 +131,7 @@
 
         charts = new ArrayList<Chart>( chartService.getSystemAndUserCharts() );
 
-        Collections.sort( charts, new ChartNameComparator() );
+        Collections.sort( charts, IdentifiableObjectNameComparator.INSTANCE );
 
         int chartsInDashboardCount = (Integer) userSettingService.getUserSetting( KEY_CHARTS_IN_DASHBOARD, DEFAULT_CHARTS_IN_DASHBOARD );
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java	2012-01-05 19:58:54 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java	2012-01-25 17:11:43 +0000
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
@@ -42,7 +43,6 @@
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataentryform.DataEntryForm;
 import org.hisp.dhis.dataentryform.DataEntryFormService;
 import org.hisp.dhis.dataset.DataSet;
@@ -339,7 +339,7 @@
         {
             des = (List<DataElement>) orderedDataElements.get( categoryCombo );
 
-            Collections.sort( des, new DataElementNameComparator() );
+            Collections.sort( des, IdentifiableObjectNameComparator.INSTANCE );
 
             orderedDataElements.put( categoryCombo, des );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java	2012-01-23 09:28:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java	2012-01-25 17:11:43 +0000
@@ -27,6 +27,14 @@
 
 package org.hisp.dhis.light.utils;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.Validate;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
@@ -39,14 +47,12 @@
 import org.hisp.dhis.datavalue.DataValueService;
 import org.hisp.dhis.datavalue.DeflatedDataValue;
 import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.minmax.MinMaxDataElement;
 import org.hisp.dhis.minmax.MinMaxDataElementService;
 import org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService;
 import org.hisp.dhis.options.SystemSettingManager;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.period.CalendarPeriodType;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.filter.OrganisationUnitWithDataSetsFilter;
@@ -62,8 +68,6 @@
 import org.joda.time.format.DateTimeFormatter;
 import org.joda.time.format.ISODateTimeFormat;
 
-import java.util.*;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -152,13 +156,6 @@
         this.expressionService = expressionService;
     }
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     // -------------------------------------------------------------------------
     // Utils
     // -------------------------------------------------------------------------
@@ -257,7 +254,7 @@
         Validate.notNull( user );
 
         List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>( user.getOrganisationUnits() );
-        Collections.sort( organisationUnits, new OrganisationUnitNameComparator() );
+        Collections.sort( organisationUnits, IdentifiableObjectNameComparator.INSTANCE );
 
         return organisationUnitWithDataSetsFilter( organisationUnits );
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java	2011-10-03 09:23:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/attribute/GetAttributeListAction.java	2012-01-25 17:11:43 +0000
@@ -35,7 +35,7 @@
 
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeNameComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -100,7 +100,7 @@
                 paging.getPageSize() ) );
         }
 
-        Collections.sort( attributes, new AttributeNameComparator() );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/GetConstantListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/GetConstantListAction.java	2011-07-06 07:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/constant/GetConstantListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.constant.Constant;
 import org.hisp.dhis.constant.ConstantService;
-import org.hisp.dhis.constant.comparator.ConstantNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -102,7 +102,7 @@
             constants = new ArrayList<Constant>( constantService.getConstantsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( constants, new ConstantNameComparator() );
+        Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/ActionSupport.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/ActionSupport.java	2011-05-24 09:08:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/ActionSupport.java	2012-01-25 17:11:43 +0000
@@ -37,6 +37,7 @@
 
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.databrowser.DataBrowserGridService;
 import org.hisp.dhis.databrowser.MetaValue;
 import org.hisp.dhis.dataelement.DataElementGroup;
@@ -47,7 +48,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.period.PeriodService;
@@ -348,7 +348,7 @@
                 list.add( o );
             }
         }
-        Collections.sort( list, new OrganisationUnitNameComparator() );
+        Collections.sort( list, IdentifiableObjectNameComparator.INSTANCE );
 
         return list;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/dataintegrity/GetDataIntegrityAction.java	2012-01-25 17:11:43 +0000
@@ -36,23 +36,17 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataintegrity.DataIntegrityService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.Section;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
-import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
-import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.validation.ValidationRule;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -267,17 +261,17 @@
 
         log.info( "Checked validation rules" );
         
-        Collections.sort( dataElementsWithoutDataSet, new DataElementNameComparator() );
-        Collections.sort( dataElementsWithoutGroups, new DataElementNameComparator() );
-        Collections.sort( dataSetsNotAssignedToOrganisationUnits, new DataSetNameComparator() );
-        Collections.sort( sectionsWithInvalidCategoryCombinations, new SectionOrderComparator() );
-        Collections.sort( indicatorsWithoutGroups, new IndicatorNameComparator() );
-        Collections.sort( organisationUnitsWithCyclicReferences, new OrganisationUnitNameComparator() );
-        Collections.sort( orphanedOrganisationUnits, new OrganisationUnitNameComparator() );
-        Collections.sort( organisationUnitsWithoutGroups, new OrganisationUnitNameComparator() );
-        Collections.sort( organisationUnitsViolatingCompulsoryGroupSets, new OrganisationUnitNameComparator() );
-        Collections.sort( organisationUnitGroupsWithoutGroupSets, new OrganisationUnitGroupNameComparator() );
-        Collections.sort( validationRulesWithoutGroups, new ValidationRuleNameComparator() );
+        Collections.sort( dataElementsWithoutDataSet, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( dataElementsWithoutGroups, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( dataSetsNotAssignedToOrganisationUnits, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( sectionsWithInvalidCategoryCombinations, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( indicatorsWithoutGroups, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( organisationUnitsWithCyclicReferences, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( orphanedOrganisationUnits, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( organisationUnitsWithoutGroups, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( organisationUnitsViolatingCompulsoryGroupSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( organisationUnitGroupsWithoutGroupSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( validationRulesWithoutGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/zerovaluestorage/OpenDataElementsZeroIsSignificantManagerAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/zerovaluestorage/OpenDataElementsZeroIsSignificantManagerAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/zerovaluestorage/OpenDataElementsZeroIsSignificantManagerAction.java	2012-01-25 17:11:43 +0000
@@ -31,16 +31,15 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
 /**
  * @author Tran Thanh Tri
  */
-
 public class OpenDataElementsZeroIsSignificantManagerAction
     implements Action
 {
@@ -73,7 +72,7 @@
         zeroDataValueElements = new ArrayList<DataElement>( dataElementService
             .getDataElementsByZeroIsSignificant( true ) );
 
-        Collections.sort( zeroDataValueElements, new DataElementNameComparator() );
+        Collections.sort( zeroDataValueElements, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.concept.Concept;
 import org.hisp.dhis.concept.ConceptService;
-import org.hisp.dhis.concept.Concept;
-import org.hisp.dhis.concept.comparator.ConceptNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 
@@ -103,7 +103,7 @@
 
         concepts = new ArrayList<Concept>( conceptService.getAllConcepts() );
 
-        Collections.sort( concepts, new ConceptNameComparator() );
+        Collections.sort( concepts, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -107,7 +107,7 @@
             dataElementCategories = new ArrayList<DataElementCategory>( dataElementCategoryService.getDataElementCategorysBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( dataElementCategories, new DataElementCategoryNameComparator() );
+        Collections.sort( dataElementCategories, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryComboNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -108,7 +108,7 @@
             dataElementCategoryCombos = new ArrayList<DataElementCategoryCombo>( dataElementCategoryService.getDataElementCategoryCombosBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
 
-        Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() );
+        Collections.sort( dataElementCategoryCombos, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryListAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -75,7 +75,7 @@
         dataElementCategories = new ArrayList<DataElementCategory>( dataElementCategoryService
             .getAllDataElementCategories() );
 
-        Collections.sort( dataElementCategories, new DataElementCategoryNameComparator() );
+        Collections.sort( dataElementCategories, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/concept/GetConceptListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.concept.Concept;
 import org.hisp.dhis.concept.ConceptService;
-import org.hisp.dhis.concept.comparator.ConceptNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -107,7 +107,7 @@
             concepts = new ArrayList<Concept>( conceptService.getConceptsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( concepts, new ConceptNameComparator() );
+        Collections.sort( concepts, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/GetDataDictionaryListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/GetDataDictionaryListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/GetDataDictionaryListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.datadictionary.DataDictionary;
 import org.hisp.dhis.datadictionary.DataDictionaryService;
-import org.hisp.dhis.datadictionary.comparator.DataDictionaryNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -99,7 +99,7 @@
             dataDictionaries = new ArrayList<DataDictionary>( dataDictionaryService.getDataDictionarysBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( dataDictionaries, new DataDictionaryNameComparator() );        
+        Collections.sort( dataDictionaries, IdentifiableObjectNameComparator.INSTANCE );        
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementAction.java	2012-01-25 17:11:43 +0000
@@ -32,10 +32,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -93,7 +93,7 @@
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService
             .getGroupsContainingDataElement( dataElement ) );
         
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java	2012-01-20 10:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/GetDataElementListAction.java	2012-01-25 17:11:43 +0000
@@ -37,7 +37,6 @@
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.datadictionary.DataDictionary;
 import org.hisp.dhis.datadictionary.DataDictionaryService;
-import org.hisp.dhis.datadictionary.comparator.DataDictionaryNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.paging.ActionPagingSupport;
@@ -143,7 +142,7 @@
 
         dataDictionaries = new ArrayList<DataDictionary>( dataDictionaryService.getAllDataDictionaries() );
 
-        Collections.sort( dataDictionaries, new DataDictionaryNameComparator() );
+        Collections.sort( dataDictionaries, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Criteria

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java	2012-01-25 17:11:43 +0000
@@ -35,13 +35,12 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryComboNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 
@@ -153,8 +152,8 @@
 
         attributes = new ArrayList<Attribute>( attributeService.getDataElementAttributes() );
 
-        Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() );
-        Collections.sort( groupSets, new DataElementGroupSetNameComparator() );
+        Collections.sort( dataElementCategoryCombos, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java	2012-01-25 17:11:43 +0000
@@ -37,14 +37,13 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryComboNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.system.util.AttributeUtils;
@@ -196,8 +195,8 @@
 
         attributeValues = AttributeUtils.getAttributeValueMap( dataElement.getAttributeValues() );
 
-        Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() );
-        Collections.sort( groupSets, new DataElementGroupSetNameComparator() );
+        Collections.sort( dataElementCategoryCombos, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/GetAssignedGroupsByDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/GetAssignedGroupsByDataElementAction.java	2011-08-19 07:40:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/GetAssignedGroupsByDataElementAction.java	2012-01-25 17:11:43 +0000
@@ -31,10 +31,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -88,7 +88,7 @@
             dataElementGroups = new ArrayList<DataElementGroup>( dataElementService
                 .getGroupsContainingDataElement( dataElement ) );
 
-            Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+            Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/ListDataElementGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -99,7 +99,7 @@
             dataElementGroupSets = new ArrayList<DataElementGroupSet>( dataElementService.getDataElementGroupSetsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( dataElementGroupSets, new DataElementGroupSetNameComparator() );
+        Collections.sort( dataElementGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroupset/OpenUpdateDataElementGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -30,10 +30,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -86,7 +86,7 @@
         
         selectedGroups = dataElementGroupSet.getMembers();
         
-        Collections.sort( selectedGroups, new DataElementGroupNameComparator() );
+        Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java	2012-01-20 10:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java	2012-01-25 17:11:43 +0000
@@ -37,7 +37,6 @@
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.datadictionary.DataDictionary;
 import org.hisp.dhis.datadictionary.DataDictionaryService;
-import org.hisp.dhis.datadictionary.comparator.DataDictionaryNameComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.paging.ActionPagingSupport;
@@ -145,7 +144,7 @@
         
         dataDictionaries = new ArrayList<DataDictionary>( dataDictionaryService.getAllDataDictionaries() );
 
-        Collections.sort( dataDictionaries, new DataDictionaryNameComparator() );
+        Collections.sort( dataDictionaries, IdentifiableObjectNameComparator.INSTANCE );
 
         // -------------------------------------------------------------------------
         // Criteria

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java	2011-10-05 15:00:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowUpdateIndicatorFormAction.java	2012-01-25 17:11:43 +0000
@@ -36,12 +36,11 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.indicator.IndicatorType;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupSetNameComparator;
-import org.hisp.dhis.indicator.comparator.IndicatorTypeNameComparator;
 import org.hisp.dhis.system.util.AttributeUtils;
 
 import com.opensymphony.xwork2.Action;
@@ -155,8 +154,8 @@
 
         attributeValues = AttributeUtils.getAttributeValueMap( indicator.getAttributeValues() );
 
-        Collections.sort( indicatorTypes, new IndicatorTypeNameComparator() );
-        Collections.sort( groupSets, new IndicatorGroupSetNameComparator() );
+        Collections.sort( indicatorTypes, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetAssignedIndicatorGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetAssignedIndicatorGroupsAction.java	2011-08-19 07:40:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetAssignedIndicatorGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,10 +31,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -88,7 +88,7 @@
 
             indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getGroupsContainingIndicator( indicator ) );
 
-            Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+            Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/GetIndicatorGroupListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -98,7 +98,7 @@
             indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getIndicatorGroupsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
 
-        Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowIndicatorGroupEditorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowIndicatorGroupEditorAction.java	2012-01-20 10:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowIndicatorGroupEditorAction.java	2012-01-25 17:11:43 +0000
@@ -35,7 +35,6 @@
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -85,7 +84,7 @@
     {
         indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );
         
-        Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         indicators = new ArrayList<Indicator>( indicatorService.getAllIndicators() );
         

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ListIndicatorGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -100,7 +100,7 @@
             indicatorGroupSets = new ArrayList<IndicatorGroupSet>( indicatorService.getIndicatorGroupSetsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( indicatorGroupSets, new IndicatorGroupSetNameComparator() );
+        Collections.sort( indicatorGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/OpenUpdateIndicatorGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -30,10 +30,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -89,7 +89,7 @@
 
         selectedGroups = indicatorGroupSet.getMembers();
         
-        Collections.sort( selectedGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatortype/GetIndicatorTypeListAction.java	2012-01-25 17:11:43 +0000
@@ -36,10 +36,10 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.indicator.IndicatorType;
-import org.hisp.dhis.indicator.comparator.IndicatorTypeNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -128,7 +128,7 @@
 
         attributes = new ArrayList<Attribute>( attributeService.getIndicatorAttributes() );
 
-        Collections.sort( indicatorTypes, new IndicatorTypeNameComparator() );
+        Collections.sort( indicatorTypes, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/DataElementGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/DataElementGroupListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/DataElementGroupListAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -76,7 +76,7 @@
     {
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
 
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/IndicatorGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/IndicatorGroupListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/IndicatorGroupListAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -74,7 +74,7 @@
     {
         indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );
 
-        Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java	2011-03-30 05:05:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java	2012-01-25 17:11:43 +0000
@@ -37,13 +37,12 @@
 
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.databrowser.MetaValue;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.system.grid.ListGrid;
 
@@ -159,9 +158,9 @@
             children.addAll( parent.getChildren() );
         }
 
-        Collections.sort( dataSets, new DataSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
 
-        Collections.sort( children, new OrganisationUnitNameComparator() );
+        Collections.sort( children, IdentifiableObjectNameComparator.INSTANCE );
 
         grid.addHeader( new GridHeader( i18n.getString( "organisation_units" ), false, true ) );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java	2012-01-20 10:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/EditSectionAction.java	2012-01-25 17:11:43 +0000
@@ -38,7 +38,6 @@
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
@@ -162,7 +161,7 @@
 
         Collections.sort( dataElementOfDataSet, new IdentifiableObjectNameComparator() );
 
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/SectionListAction.java	2012-01-25 17:11:43 +0000
@@ -34,13 +34,13 @@
 import java.util.List;
 import java.util.Set;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
 
 import com.opensymphony.xwork2.Action;
@@ -132,7 +132,7 @@
     {
         datasets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
 
-        Collections.sort( datasets, new DataSetNameComparator() );
+        Collections.sort( datasets, IdentifiableObjectNameComparator.INSTANCE );
 
         Collection<Section> temp = sectionService.getAllSections();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/MobileDataSetListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/MobileDataSetListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/MobileDataSetListAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -71,7 +71,7 @@
         throws Exception
     {
         mobileDatasets = new ArrayList<DataSet>(dataSetService.getDataSetsForMobile());
-        Collections.sort( mobileDatasets, new DataSetNameComparator() );
+        Collections.sort( mobileDatasets, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java	2011-11-21 12:44:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitAction.java	2012-01-25 17:11:43 +0000
@@ -27,6 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.ValidationUtils.coordinateIsValid;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -35,22 +37,18 @@
 
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 import org.hisp.dhis.system.util.AttributeUtils;
 import org.hisp.dhis.system.util.ValidationUtils;
 
 import com.opensymphony.xwork2.Action;
 
-import static org.hisp.dhis.system.util.ValidationUtils.*;
-
 /**
  * @author Torgeir Lorange Ostby
  */
@@ -193,10 +191,10 @@
 
         attributeValues = AttributeUtils.getAttributeValueMap( organisationUnit.getAttributeValues() );
 
-        Collections.sort( availableDataSets, new DataSetNameComparator() );
-        Collections.sort( dataSets, new DataSetNameComparator() );
-        Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() );
-        Collections.sort( attributes, new AttributeSortOrderComparator() );
+        Collections.sort( availableDataSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Allow update only if org unit does not have polygon coordinates

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java	2011-11-03 20:43:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/PrepareAddOrganisationUnitAction.java	2012-01-25 17:11:43 +0000
@@ -35,12 +35,11 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 import org.hisp.dhis.period.Cal;
 
 import com.opensymphony.xwork2.Action;
@@ -124,8 +123,8 @@
 
         attributes = new ArrayList<Attribute>( attributeService.getOrganisationUnitAttributes() );
 
-        Collections.sort( dataSets, new DataSetNameComparator() );
-        Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/GetOrganisationUnitGroupListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -99,7 +99,7 @@
             organisationUnitGroups = new ArrayList<OrganisationUnitGroup>( organisationUnitGroupService.getOrganisationUnitGroupsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
 
-        Collections.sort( organisationUnitGroups, new OrganisationUnitGroupNameComparator() );
+        Collections.sort( organisationUnitGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/GetGroupSetListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/GetGroupSetListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/GetGroupSetListAction.java	2012-01-25 17:11:43 +0000
@@ -33,9 +33,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 
 /**
@@ -99,10 +99,7 @@
             organisationUnitGroupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getOrganisationUnitGroupSetsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
 
-//        organisationUnitGroupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService
-//            .getAllOrganisationUnitGroupSets() );
-
-        Collections.sort( organisationUnitGroupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( organisationUnitGroupSets, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/PrepareUpdateGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -31,10 +31,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -91,7 +91,7 @@
 
         selectedGroups = new ArrayList<OrganisationUnitGroup>( organisationUnitGroupSet.getOrganisationUnitGroups() );
 
-        Collections.sort( selectedGroups, new OrganisationUnitGroupNameComparator() );
+        Collections.sort( selectedGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ValidateGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ValidateGroupSetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/ValidateGroupSetAction.java	2012-01-25 17:11:43 +0000
@@ -29,6 +29,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 
@@ -36,7 +37,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.system.util.ListUtils;
 
 import com.opensymphony.xwork2.Action;
@@ -138,8 +138,13 @@
                 units.addAll( organisationUnitGroupService.getOrganisationUnitGroup( groupId ).getMembers() );
             }
 
-            Collection<OrganisationUnit> duplicates = ListUtils.getDuplicates( units,
-                new OrganisationUnitNameComparator() );
+            Collection<OrganisationUnit> duplicates = ListUtils.getDuplicates( units, new Comparator<OrganisationUnit>()
+            {
+                public int compare( OrganisationUnit o1, OrganisationUnit o2 )
+                {
+                    return o1.getName().compareTo( o2.getName() );
+                }
+            } );
 
             if ( duplicates.size() > 0 )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/GetOrganisationUnitDetailsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/GetOrganisationUnitDetailsAction.java	2010-12-12 20:39:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/GetOrganisationUnitDetailsAction.java	2012-01-25 17:11:43 +0000
@@ -4,11 +4,11 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -77,7 +77,7 @@
 
         groupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() );
         
-        Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/SearchOrganisationUnitsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/SearchOrganisationUnitsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/search/SearchOrganisationUnitsAction.java	2012-01-25 17:11:43 +0000
@@ -38,13 +38,12 @@
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.system.grid.ListGrid;
 
@@ -182,7 +181,7 @@
 
         groupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() );
         
-        Collections.sort( groupSets, new OrganisationUnitGroupSetNameComparator() );
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         
         // ---------------------------------------------------------------------
         // Assemble groups and get search result
@@ -219,7 +218,7 @@
             
             limited = organisationUnits != null && organisationUnits.size() == OrganisationUnitService.MAX_LIMIT;
             
-            Collections.sort( organisationUnits, new OrganisationUnitNameComparator() );
+            Collections.sort( organisationUnits, IdentifiableObjectNameComparator.INSTANCE );
             
             if ( type != null && !type.equalsIgnoreCase( DEFAULT_TYPE ) )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java	2012-01-11 05:31:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java	2012-01-25 17:11:43 +0000
@@ -31,10 +31,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.comparator.PatientAttributeComparator;
@@ -134,7 +134,7 @@
         throws Exception
     {
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         programs = new ArrayList<Program>( programService.getAllPrograms() );
         Collections.sort( programs, new ProgramNameComparator() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java	2011-05-26 05:41:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 
 import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
 import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.comparator.PatientAttributeComparator;
@@ -152,7 +152,7 @@
         throws Exception
     {
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         programs = new ArrayList<Program>( programService.getAllPrograms() );
         Collections.sort( programs, new ProgramNameComparator() );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetGeneralSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetGeneralSettingsAction.java	2011-10-07 11:48:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetGeneralSettingsAction.java	2012-01-25 17:11:43 +0000
@@ -32,11 +32,11 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.configuration.Configuration;
 import org.hisp.dhis.configuration.ConfigurationService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.options.SystemSettingManager;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
@@ -161,7 +161,7 @@
         
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
 
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         periodTypes = new ArrayList<PeriodType>( periodService.getAllPeriodTypes() );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetRoleAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetRoleAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetRoleAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.security.authority.SystemAuthoritiesProvider;
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.user.UserService;
@@ -139,11 +139,11 @@
 
         availableDataSets.removeAll( userAuthorityGroup.getDataSets() );
 
-        Collections.sort( availableDataSets, new DataSetNameComparator() );
+        Collections.sort( availableDataSets, IdentifiableObjectNameComparator.INSTANCE );
 
         roleDataSets = new ArrayList<DataSet>( userAuthorityGroup.getDataSets() );
 
-        Collections.sort( roleDataSets, new DataSetNameComparator() );
+        Collections.sort( roleDataSets, IdentifiableObjectNameComparator.INSTANCE );
 
         // ---------------------------------------------------------------------
         // Authorities

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupSetsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupSetsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupSetsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -75,7 +75,7 @@
     {
         object = new ArrayList<DataElementGroupSet>( dataElementService.getAllDataElementGroupSets() );
 
-        Collections.sort( object, new DataElementGroupSetNameComparator() );
+        Collections.sort( object, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllDataElementGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -75,7 +75,7 @@
     {
         object = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
 
-        Collections.sort( object, new DataElementGroupNameComparator() );
+        Collections.sort( object, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorGroupsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllIndicatorGroupsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -75,7 +75,7 @@
     {
         object = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );
         
-        Collections.sort( object, new IndicatorGroupNameComparator() );
+        Collections.sort( object, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }    

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessOptionsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.period.PeriodType;
 
 import com.opensymphony.xwork2.Action;
@@ -82,7 +82,7 @@
     {
         dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
         
-        Collections.sort( dataSets, new DataSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
         
         periodTypes = PeriodType.getAvailablePeriodTypes();
         

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GetDataSetReportOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GetDataSetReportOptionsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GetDataSetReportOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.period.PeriodType;
 
 import com.opensymphony.xwork2.Action;
@@ -69,7 +69,7 @@
     {
         dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
         
-        Collections.sort( dataSets, new DataSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
         
         periodTypes = PeriodType.getAvailablePeriodTypes();
         

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionOptionsAction.java	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -29,12 +29,11 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -44,8 +43,6 @@
 public class GetOrgUnitDistributionOptionsAction
     implements Action
 {
-    private static final Comparator<OrganisationUnitGroupSet> GROUPSET_COMPARATOR = new OrganisationUnitGroupSetNameComparator();
-    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -76,7 +73,7 @@
     {
         groupSets = new ArrayList<OrganisationUnitGroupSet>( organisationUnitGroupService.getAllOrganisationUnitGroupSets() );
         
-        Collections.sort( groupSets, GROUPSET_COMPARATOR );        
+        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );        
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/pivottable/action/GetPivotTableOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/pivottable/action/GetPivotTableOptionsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/pivottable/action/GetPivotTableOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -31,12 +31,11 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.period.PeriodType;
 
 import com.opensymphony.xwork2.Action;
@@ -89,8 +88,8 @@
         indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
         
-        Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
-        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+        Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.report.ReportService;
-import org.hisp.dhis.report.comparator.ReportComparator;
 
 /**
  * @author Lars Helge Overland
@@ -88,7 +88,7 @@
     {
         reports = new ArrayList<Report>( reportService.getAllReports() );
         
-        Collections.sort( reports, new ReportComparator() );
+        Collections.sort( reports, IdentifiableObjectNameComparator.INSTANCE );
         
         if ( isNotBlank( key ) )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportOptionsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -29,14 +29,13 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.report.ReportService;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.reporttable.ReportTableService;
-import org.hisp.dhis.reporttable.comparator.ReportTableComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -47,8 +46,6 @@
 public class GetReportOptionsAction
     implements Action
 {
-    private static final Comparator<ReportTable> COMPARATOR = new ReportTableComparator();
-    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -104,7 +101,7 @@
     {
         reportTables = new ArrayList<ReportTable>( reportTableService.getAllReportTables() );
         
-        Collections.sort( reportTables, COMPARATOR );
+        Collections.sort( reportTables, IdentifiableObjectNameComparator.INSTANCE );
         
         if ( id != null )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetAllTablesAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetAllTablesAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetAllTablesAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.reporttable.ReportTableService;
-import org.hisp.dhis.reporttable.comparator.ReportTableComparator;
 
 /**
  * @author Lars Helge Overland
@@ -98,7 +98,7 @@
             tables = new ArrayList<ReportTable>( reportTableService.getReportTablesBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( tables, new ReportTableComparator() );
+        Collections.sort( tables, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableOptionsAction.java	2012-01-20 10:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetTableOptionsAction.java	2012-01-25 17:11:43 +0000
@@ -42,17 +42,12 @@
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementCategoryComboNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -333,25 +328,25 @@
         if ( dimension )
         {
             categoryCombos = new ArrayList<DataElementCategoryCombo>( categoryService.getAllDataElementCategoryCombos() );            
-            Collections.sort( categoryCombos, new DataElementCategoryComboNameComparator() );            
+            Collections.sort( categoryCombos, IdentifiableObjectNameComparator.INSTANCE );            
         }
         else
         {        
             dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );            
-            Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
+            Collections.sort( dataElementGroups, IdentifiableObjectNameComparator.INSTANCE );
             
             dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );            
-            Collections.sort( dataElements, new DataElementNameComparator() );            
+            Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );            
             FilterUtils.filter( dataElements, new AggregatableDataElementFilter() );
             
             indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );            
-            Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+            Collections.sort( indicatorGroups, IdentifiableObjectNameComparator.INSTANCE );
             
             indicators = new ArrayList<Indicator>( indicatorService.getAllIndicators() );            
             Collections.sort( indicators, indicatorComparator );
             
             dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );            
-            Collections.sort( dataSets, new DataSetNameComparator() ); 
+            Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE ); 
         }
         
         periodTypes = periodService.getAllPeriodTypes();

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/SelectTallySheetAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/SelectTallySheetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/SelectTallySheetAction.java	2012-01-25 17:11:43 +0000
@@ -32,9 +32,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -75,7 +75,7 @@
         throws Exception
     {
         dataSets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
-        Collections.sort( dataSets, new DataSetNameComparator() );
+        Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/ViewTallySheetAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/ViewTallySheetAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/ViewTallySheetAction.java	2012-01-25 17:11:43 +0000
@@ -31,8 +31,8 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -188,7 +188,7 @@
         organisationUnit = selectionTreeManager.getSelectedOrganisationUnit();
         selectedDataSet = dataSetService.getDataSet( selectedDataSetId );
         dataElements = new ArrayList<DataElement>( dataSetService.getDataElements( selectedDataSet ) );
-        Collections.sort( dataElements, new DataElementNameComparator() );
+        Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
 
         tallySheet = tallySheetService.createTallySheet( organisationUnit, dataElements, largeFormat,
             displayFacilityName, selectedDataSet, tallySheetName );

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleListAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/GetValidationRuleListAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 /**
  * @author Margrethe Store
@@ -98,7 +98,7 @@
             validationRulesList = new ArrayList<ValidationRule>( validationRuleService.getValidationRulesBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
 
-        Collections.sort( validationRulesList, new ValidationRuleNameComparator() );
+        Collections.sort( validationRulesList, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/SetupTreeAction.java	2012-01-25 17:11:43 +0000
@@ -32,13 +32,13 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleGroupNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -118,7 +118,7 @@
 
         validationRuleGroups = new ArrayList<ValidationRuleGroup>( validationRuleService.getAllValidationRuleGroups() );
 
-        Collections.sort( validationRuleGroups, new ValidationRuleGroupNameComparator() );
+        Collections.sort( validationRuleGroups, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/GetValidationRuleGroupListAction.java	2012-01-25 17:11:43 +0000
@@ -33,10 +33,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleGroupNameComparator;
 
 /**
 * @author Lars Helge Overland
@@ -98,7 +98,7 @@
             validationRuleGroups = new ArrayList<ValidationRuleGroup>( validationRuleService.getValidationRuleGroupsBetween( paging.getStartPos(), paging.getPageSize() ) );
         }
         
-        Collections.sort( validationRuleGroups, new ValidationRuleGroupNameComparator() );
+        Collections.sort( validationRuleGroups, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java	2011-06-15 09:16:51 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java	2012-01-25 17:11:43 +0000
@@ -31,10 +31,10 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -108,7 +108,7 @@
 
         groupMembers = new ArrayList<ValidationRule>( validationRuleGroup.getMembers() );
 
-        Collections.sort( groupMembers, new ValidationRuleNameComparator() );
+        Collections.sort( groupMembers, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }