Repository: syncope
Updated Branches:
  refs/heads/master a8eff1cc2 -> a346bbf6a


[SYNCOPE-1254] Fighting (and losing) with Java 8 lambda


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/8ef021e2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/8ef021e2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/8ef021e2

Branch: refs/heads/master
Commit: 8ef021e23f67027dda842559029fd65788beb865
Parents: a8eff1c
Author: Francesco Chicchiriccò <ilgro...@apache.org>
Authored: Tue Apr 3 13:13:07 2018 +0200
Committer: Francesco Chicchiriccò <ilgro...@apache.org>
Committed: Tue Apr 3 13:13:07 2018 +0200

----------------------------------------------------------------------
 .../wizards/resources/ConnectorDetailsPanel.java     | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/8ef021e2/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ConnectorDetailsPanel.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ConnectorDetailsPanel.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ConnectorDetailsPanel.java
index 1a5f9a7..d69b7d3 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ConnectorDetailsPanel.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ConnectorDetailsPanel.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.client.console.wizards.resources;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
@@ -56,14 +55,12 @@ public class ConnectorDetailsPanel extends WizardStep {
 
             @Override
             protected List<String> load() {
-                List<RealmTO> allRealms = new RealmRestClient().list();
-                allRealms.removeAll(allRealms.stream().filter(realm
-                        -> authRealms.stream().anyMatch(fullpath -> 
realm.getFullPath().startsWith(fullpath))).
-                        collect(Collectors.toList()));
-
-                List<String> result = 
allRealms.stream().map(RealmTO::getFullPath).collect(Collectors.toList());
-                Collections.sort(result);
-                return result;
+                return new RealmRestClient().list().stream().
+                        filter(realm -> authRealms.stream().
+                        anyMatch(authRealm -> 
realm.getFullPath().startsWith(authRealm))).
+                        map(RealmTO::getFullPath).
+                        sorted().
+                        collect(Collectors.toList());
             }
         };
 

Reply via email to