← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21255: Substitute java.util.AbstractMap.SimpleEntry for javafx.util.Pair

 

------------------------------------------------------------
revno: 21255
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Tue 2015-12-01 13:08:11 -0500
message:
  Substitute java.util.AbstractMap.SimpleEntry for javafx.util.Pair
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java	2015-11-30 03:36:54 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java	2015-12-01 18:08:11 +0000
@@ -67,7 +67,6 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import javafx.util.Pair;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -80,6 +79,8 @@
 import java.util.Set;
 
 import static com.google.common.collect.Lists.newArrayList;
+import static java.util.AbstractMap.SimpleEntry;
+
 
 /**
  * This controller uses both /dataApprovals and /dataAcceptances.
@@ -265,16 +266,16 @@
 
         OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ou );
 
-        Set<Pair<DataApprovalWorkflow, DataElementCategoryCombo>> pairs = new HashSet<>();
+        Set<SimpleEntry<DataApprovalWorkflow, DataElementCategoryCombo>> pairs = new HashSet<>();
 
         for ( DataSet dataSet : dataSets )
         {
-            pairs.add( new Pair<>( dataSet.getWorkflow(), dataSet.getCategoryCombo() ) );
+            pairs.add( new SimpleEntry<>( dataSet.getWorkflow(), dataSet.getCategoryCombo() ) );
         }
 
         List<DataApprovalStatus> statusList = new ArrayList<>();
 
-        for ( Pair<DataApprovalWorkflow, DataElementCategoryCombo> pair : pairs )
+        for ( SimpleEntry<DataApprovalWorkflow, DataElementCategoryCombo> pair : pairs )
         {
             statusList.addAll( dataApprovalService.getUserDataApprovalsAndPermissions( pair.getKey(), period, orgUnit, pair.getValue() ) );
         }