mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-1170: Use checked versions of empty list/set/map.
This commit is contained in:
@@ -316,7 +316,7 @@ public abstract class ModeledDirectoryObjectService<InternalType extends Modeled
|
||||
|
||||
// Do not query if no identifiers given
|
||||
if (identifiers.isEmpty())
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<InternalType>emptyList();
|
||||
|
||||
Collection<ModelType> objects;
|
||||
|
||||
|
@@ -96,7 +96,7 @@ public abstract class ModeledGroupedDirectoryObjectService<InternalType extends
|
||||
|
||||
// If both parents have the same identifier, nothing has changed
|
||||
if (parentIdentifier != null && parentIdentifier.equals(oldParentIdentifier))
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<String>emptyList();
|
||||
|
||||
}
|
||||
|
||||
|
@@ -424,12 +424,12 @@ public abstract class AbstractGuacamoleTunnelService implements GuacamoleTunnelS
|
||||
|
||||
// If not a balancing group, there are no balanced connections
|
||||
if (connectionGroup.getType() != ConnectionGroup.Type.BALANCING)
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<ModeledConnection>emptyList();
|
||||
|
||||
// If group has no children, there are no balanced connections
|
||||
Collection<String> identifiers = connectionMapper.selectIdentifiersWithin(connectionGroup.getIdentifier());
|
||||
if (identifiers.isEmpty())
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<ModeledConnection>emptyList();
|
||||
|
||||
// Retrieve all children
|
||||
Collection<ConnectionModel> models = connectionMapper.select(identifiers);
|
||||
@@ -453,7 +453,7 @@ public abstract class AbstractGuacamoleTunnelService implements GuacamoleTunnelS
|
||||
// Simply return empty list if there are no active tunnels
|
||||
Collection<ActiveConnectionRecord> records = activeTunnels.values();
|
||||
if (records.isEmpty())
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<ActiveConnectionRecord>emptyList();
|
||||
|
||||
// Build set of all connection identifiers associated with active tunnels
|
||||
Set<String> identifiers = new HashSet<String>(records.size());
|
||||
@@ -521,7 +521,7 @@ public abstract class AbstractGuacamoleTunnelService implements GuacamoleTunnelS
|
||||
|
||||
// If not a balancing group, assume no connections
|
||||
if (connectionGroup.getType() != ConnectionGroup.Type.BALANCING)
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<ActiveConnectionRecord>emptyList();
|
||||
|
||||
return activeConnectionGroups.get(connectionGroup.getIdentifier());
|
||||
|
||||
|
@@ -120,7 +120,7 @@ public class ActiveConnectionMultimap {
|
||||
if (connections != null)
|
||||
return Collections.unmodifiableCollection(connections);
|
||||
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.<ActiveConnectionRecord>emptyList();
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user