Cleanup
authorFrancesco Chicchiriccò <ilgrosso@apache.org>
Mon, 18 Jun 2018 11:47:58 +0000 (13:47 +0200)
committerFrancesco Chicchiriccò <ilgrosso@apache.org>
Mon, 18 Jun 2018 11:47:58 +0000 (13:47 +0200)
client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java

index 4a72fb9..755c11e 100644 (file)
@@ -19,7 +19,6 @@
 package org.apache.syncope.client.console.wizards.resources;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.stream.Collectors;
 import org.apache.syncope.client.console.rest.PolicyRestClient;
@@ -48,11 +47,8 @@ public class ResourceSecurityPanel extends WizardStep {
 
         @Override
         protected Map<String, String> load() {
-            Map<String, String> res = new HashMap<>();
-            policyRestClient.getPolicies(PolicyType.PASSWORD).forEach(policyTO -> {
-                res.put(policyTO.getKey(), policyTO.getDescription());
-            });
-            return res;
+            return policyRestClient.getPolicies(PolicyType.PASSWORD).stream().
+                    collect(Collectors.toMap(PolicyTO::getKey, PolicyTO::getDescription));
         }
     };
 
@@ -62,11 +58,8 @@ public class ResourceSecurityPanel extends WizardStep {
 
         @Override
         protected Map<String, String> load() {
-            Map<String, String> res = new HashMap<>();
-            policyRestClient.getPolicies(PolicyType.ACCOUNT).forEach(policyTO -> {
-                res.put(policyTO.getKey(), policyTO.getDescription());
-            });
-            return res;
+            return policyRestClient.getPolicies(PolicyType.ACCOUNT).stream().
+                    collect(Collectors.toMap(PolicyTO::getKey, PolicyTO::getDescription));
         }
     };
 
@@ -144,7 +137,7 @@ public class ResourceSecurityPanel extends WizardStep {
         // -------------------------------
 
         // -------------------------------
-        // Pull policy selection
+        // Push policy selection
         // -------------------------------
         AjaxDropDownChoicePanel<String> pushPolicy = new AjaxDropDownChoicePanel<>(
                 "pushPolicy",