From: David ‘Bombe’ Roden Date: Thu, 30 Apr 2015 04:39:32 +0000 (+0200) Subject: Return unmodifiable view of packs X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=428a71042507e2fe0fce5b1b144ed60ec49d3183;p=xudocci.git Return unmodifiable view of packs --- diff --git a/src/main/java/net/pterodactylus/xdcc/data/Bot.java b/src/main/java/net/pterodactylus/xdcc/data/Bot.java index 0f09671..c9e2a9b 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Bot.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Bot.java @@ -20,6 +20,7 @@ package net.pterodactylus.xdcc.data; import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.Map; @@ -83,7 +84,7 @@ public class Bot implements Iterable { */ public Collection packs() { synchronized (packs) { - return packs.values(); + return Collections.unmodifiableCollection(packs.values()); } }