Roberto Sánchez
2014-01-18 602c4c4501dcd89cbce1d6ba61ba6bc75761d643
securis/src/main/java/net/curisit/securis/services/UserResource.java
....@@ -1,8 +1,9 @@
11 package net.curisit.securis.services;
22
3
-import java.util.ArrayList;
43 import java.util.Date;
4
+import java.util.HashSet;
55 import java.util.List;
6
+import java.util.Set;
67
78 import javax.inject.Inject;
89 import javax.inject.Provider;
....@@ -113,10 +114,10 @@
113114 return modify(user, user.getUsername(), token);
114115 }
115116
116
- List<Organization> orgs = null;
117
+ Set<Organization> orgs = null;
117118 List<Integer> orgsIds = user.getOrgsIds();
118119 if (orgsIds != null && orgsIds.size() > 0) {
119
- orgs = new ArrayList<>();
120
+ orgs = new HashSet<>();
120121 for (Integer orgId : orgsIds) {
121122 Organization o = em.find(Organization.class, orgId);
122123 if (o == null) {
....@@ -152,10 +153,10 @@
152153 return create(user, token);
153154 }
154155
155
- List<Organization> orgs = null;
156
+ Set<Organization> orgs = null;
156157 List<Integer> orgsIds = user.getOrgsIds();
157158 if (orgsIds != null && orgsIds.size() > 0) {
158
- orgs = new ArrayList<>();
159
+ orgs = new HashSet<>();
159160 for (Integer orgId : orgsIds) {
160161 Organization o = em.find(Organization.class, orgId);
161162 if (o == null) {