mneethiraj commented on code in PR #311: URL: https://github.com/apache/ranger/pull/311#discussion_r1589731450
########## agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerPolicyValidator.java: ########## @@ -958,6 +958,22 @@ private String getDuplicate(List<String> values) { } return duplicate; } + private void removeDuplicates(List<String> values){ + if (values==null || values.isEmpty()){ + return; + } + Iterator<String> itr = values.iterator(); + HashSet<String> uniqueElements = new HashSet<>(); Review Comment: Consider replacing #965 to #975 with the following: ``` Set<String> uniqueElements = new HashSet<>(); for (Iterator<String> iter = values.iterator(); iter.hasNext(); ) { if (!uniqueElements.add(iter.next())) { iter.remove(); } } ``` -- 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