| .. | .. |
|---|
| 1 | 1 | package net.curisit.securis.services; |
|---|
| 2 | 2 | |
|---|
| 3 | | -import java.util.ArrayList; |
|---|
| 4 | 3 | import java.util.Date; |
|---|
| 4 | +import java.util.HashSet; |
|---|
| 5 | 5 | import java.util.List; |
|---|
| 6 | +import java.util.Set; |
|---|
| 6 | 7 | |
|---|
| 7 | 8 | import javax.inject.Inject; |
|---|
| 8 | 9 | import javax.inject.Provider; |
|---|
| .. | .. |
|---|
| 113 | 114 | return modify(user, user.getUsername(), token); |
|---|
| 114 | 115 | } |
|---|
| 115 | 116 | |
|---|
| 116 | | - List<Organization> orgs = null; |
|---|
| 117 | + Set<Organization> orgs = null; |
|---|
| 117 | 118 | List<Integer> orgsIds = user.getOrgsIds(); |
|---|
| 118 | 119 | if (orgsIds != null && orgsIds.size() > 0) { |
|---|
| 119 | | - orgs = new ArrayList<>(); |
|---|
| 120 | + orgs = new HashSet<>(); |
|---|
| 120 | 121 | for (Integer orgId : orgsIds) { |
|---|
| 121 | 122 | Organization o = em.find(Organization.class, orgId); |
|---|
| 122 | 123 | if (o == null) { |
|---|
| .. | .. |
|---|
| 152 | 153 | return create(user, token); |
|---|
| 153 | 154 | } |
|---|
| 154 | 155 | |
|---|
| 155 | | - List<Organization> orgs = null; |
|---|
| 156 | + Set<Organization> orgs = null; |
|---|
| 156 | 157 | List<Integer> orgsIds = user.getOrgsIds(); |
|---|
| 157 | 158 | if (orgsIds != null && orgsIds.size() > 0) { |
|---|
| 158 | | - orgs = new ArrayList<>(); |
|---|
| 159 | + orgs = new HashSet<>(); |
|---|
| 159 | 160 | for (Integer orgId : orgsIds) { |
|---|
| 160 | 161 | Organization o = em.find(Organization.class, orgId); |
|---|
| 161 | 162 | if (o == null) { |
|---|