bug5541: trying to fix test set-up for OSGi environment

This commit is contained in:
Axel Uhl
2021-05-16 17:21:31 +02:00
parent bac1139ebd
commit 04349fbcf1
2 changed files with 33 additions and 13 deletions
@@ -749,8 +749,11 @@ public class UserStoreImpl implements UserStore {
*/
private void checkGroupNameAndIdUniqueness(UUID groupId, String name) throws UserGroupManagementException {
assert userGroupsLock.isWriteLockedByCurrentThread() || userGroupsLock.getReadHoldCount() > 0;
if (userGroupsByName.containsKey(name) || userGroups.containsKey(groupId)) {
throw new UserGroupManagementException(UserGroupManagementException.USER_GROUP_ALREADY_EXISTS);
if (userGroupsByName.containsKey(name)) {
throw new UserGroupManagementException(UserGroupManagementException.USER_GROUP_ALREADY_EXISTS+": "+name);
}
if (userGroups.containsKey(groupId)) {
throw new UserGroupManagementException(UserGroupManagementException.USER_GROUP_ALREADY_EXISTS+": "+groupId);
}
}