mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-220: Remove unnecessary use of multi-result select (use selectOne() instead).
This commit is contained in:
@@ -21,8 +21,6 @@ package org.apache.guacamole.auth.jdbc.usergroup;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import org.apache.guacamole.auth.jdbc.base.ModeledDirectoryObjectMapper;
|
||||
import org.apache.guacamole.auth.jdbc.base.ModeledDirectoryObjectService;
|
||||
import org.apache.guacamole.GuacamoleClientException;
|
||||
@@ -147,8 +145,8 @@ public class UserGroupService extends ModeledDirectoryObjectService<ModeledUserG
|
||||
throw new GuacamoleClientException("The group name must not be blank.");
|
||||
|
||||
// Do not create duplicate user groups
|
||||
Collection<UserGroupModel> existing = userGroupMapper.select(Collections.singleton(model.getIdentifier()));
|
||||
if (!existing.isEmpty())
|
||||
UserGroupModel existing = userGroupMapper.selectOne(model.getIdentifier());
|
||||
if (existing != null)
|
||||
throw new GuacamoleClientException("Group \"" + model.getIdentifier() + "\" already exists.");
|
||||
|
||||
// Create base entity object, implicitly populating underlying entity ID
|
||||
|
Reference in New Issue
Block a user