DaanHoogland commented on a change in pull request #3694: Ldap fixes
URL: https://github.com/apache/cloudstack/pull/3694#discussion_r361098706
 
 

 ##########
 File path: 
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/api/command/LdapListUsersCmd.java
 ##########
 @@ -201,33 +199,10 @@ public void execute() throws ServerApiException {
         if(s_logger.isTraceEnabled()) {
             s_logger.trace(String.format("applying filter: %s or %s.", 
this.getListTypeString(), this.getUserFilter()));
         }
-        Method filterMethod = getFilterMethod();
-        List<LdapUserResponse> responseList = ldapResponses;
-        if (filterMethod != null) {
-            if(s_logger.isTraceEnabled()) {
-                s_logger.trace("applying filter: " + filterMethod.getName());
-            }
-            try {
-                responseList = 
(List<LdapUserResponse>)filterMethod.invoke(this, ldapResponses);
-            } catch (IllegalAccessException | InvocationTargetException e) {
-                throw new CloudRuntimeException("we're damned, the earth is 
screwed. we will now return to our maker",e);
-            }
-        }
+        List<LdapUserResponse> responseList = 
getUserFilter().filter(this,ldapResponses);
 
 Review comment:
   tnx @rhtyd. @nvazquez I am not changing this. Having functionality specific 
to an enum value be implemented by that enum value is a more neat solution than 
having a switch in calling code. we'll have a beer about it, next conf.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to