← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18665: Change == to .equals() to compare attributeOptionCombo in HibernateDataApprovalStore.getDataAppro...

 

------------------------------------------------------------
revno: 18665
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Mon 2015-03-23 13:01:34 -0400
message:
  Change == to .equals() to compare attributeOptionCombo in HibernateDataApprovalStore.getDataApprovals()
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalStore.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalStore.java	2015-03-23 17:01:34 +0000
@@ -91,7 +91,8 @@
      * to a given organisation unit, or it may be all the organisation units
      * the user is allowed to see. The list may also be constrained to a given
      * attribute category combination, or it may be all the attribute category
-     * combos the user is allowed to see.
+     * combos the user is allowed to see. If the list is constrained to a given
+     * attribute category combination, then only a single value is returned.
      *
      * @param dataSets Data sets to look within
      * @param period Period to look within

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2015-03-19 19:17:43 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java	2015-03-23 17:01:34 +0000
@@ -237,7 +237,7 @@
 
         final String dataSetIds = getCommaDelimitedString( getIdentifiers( DataSet.class, dataSets ) );
 
-        boolean isDefaultCombo = ( attributeOptionCombo == categoryService.getDefaultDataElementCategoryOptionCombo() );
+        boolean isDefaultCombo = categoryService.getDefaultDataElementCategoryOptionCombo().equals( attributeOptionCombo );
 
         final String categoryComboIds;