diff --git a/Model/src/main/java/org/gusdb/wdk/model/user/UserFactory.java b/Model/src/main/java/org/gusdb/wdk/model/user/UserFactory.java index f885ebc55..fcd98ac64 100644 --- a/Model/src/main/java/org/gusdb/wdk/model/user/UserFactory.java +++ b/Model/src/main/java/org/gusdb/wdk/model/user/UserFactory.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; @@ -177,10 +178,14 @@ public void resetPassword(String loginName) throws InvalidUsernameOrEmailExcepti // ------------------------------------------------------------------------- public Map getUsersById(List userIds) { + // ensure a unique list + userIds = new ArrayList<>(new HashSet<>(userIds)); return OAuthQuerier.getUsersById(_client, _config, userIds, json -> new BasicUser(_wdkModel, json)); } public Map getUsersByEmail(List emails) { + // ensure a unique list + emails = new ArrayList<>(new HashSet<>(emails)); return OAuthQuerier.getUsersByEmail(_client, _config, emails, json -> new BasicUser(_wdkModel, json)); }