Copilot commented on code in PR #11636:
URL: https://github.com/apache/cloudstack/pull/11636#discussion_r2348643571


##########
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/OpenLdapUserManagerImpl.java:
##########
@@ -91,7 +91,7 @@ private String generateSearchFilter(final String username, 
Long domainId) {
         StringBuilder ldapGroupsFilter = new StringBuilder();
         // this should get the trustmaps for this domain
         List<String> ldapGroups = getMappedLdapGroups(domainId);
-        if (null != ldapGroups && ldapGroups.size() > 0) {
+        if (CollectionUtils.isNotEmpty(ldapGroups)) {

Review Comment:
   [nitpick] Consider using `!ldapGroups.isEmpty()` instead of 
`CollectionUtils.isNotEmpty()` since you're already checking for null in 
`getMappedLdapGroups()` method which always returns a non-null list. This would 
eliminate the external dependency and improve performance.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to