eubnara commented on code in PR #516: URL: https://github.com/apache/ranger/pull/516#discussion_r1925202135
########## ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java: ########## @@ -1732,15 +1714,26 @@ private void computeDeletedGroups(Map<String, Map<String, String>> sourceGroups) deletedGroups = new HashMap<>(); + Set<String> sourceGroupNames = new HashSet<>(); + for (Map<String, String> attrs : sourceGroups.values()) { + sourceGroupNames.add(attrs.get(UgsyncCommonConstants.ORIGINAL_NAME)); + } + // Check if the group from cache exists in the sourceGroups. If not, mark as deleted group. - for (XGroupInfo groupInfo : groupCache.values()) { + for (Map.Entry<String, XGroupInfo> entry : groupCache.entrySet()) { + String groupName = entry.getKey(); + XGroupInfo groupInfo = entry.getValue(); Map<String, String> groupOtherAttrs = groupInfo.getOtherAttrsMap(); String groupDN = groupOtherAttrs != null ? groupOtherAttrs.get(UgsyncCommonConstants.FULL_NAME) : null; if (StringUtils.isNotEmpty(groupDN) && !sourceGroups.containsKey(groupDN) && StringUtils.equalsIgnoreCase(groupOtherAttrs.get(UgsyncCommonConstants.SYNC_SOURCE), currentSyncSource) && StringUtils.equalsIgnoreCase(groupOtherAttrs.get(UgsyncCommonConstants.LDAP_URL), ldapUrl)) { - if (ISHIDDEN.equals(groupInfo.getIsVisible())) { Review Comment: This is bug introduced by typo. -- 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: dev-unsubscr...@ranger.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org