Return unmodifiable view of packs
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 30 Apr 2015 04:39:32 +0000 (06:39 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 30 Apr 2015 04:39:32 +0000 (06:39 +0200)
src/main/java/net/pterodactylus/xdcc/data/Bot.java

index 0f09671..c9e2a9b 100644 (file)
@@ -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<Pack> {
         */
        public Collection<Pack> packs() {
                synchronized (packs) {
-                       return packs.values();
+                       return Collections.unmodifiableCollection(packs.values());
                }
        }