Fix synchronization.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:43:24 +0000 (06:43 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:43:24 +0000 (06:43 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index cdb7feb..4d39c10 100644 (file)
@@ -352,7 +352,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         * @return All Sones
         */
        public Set<Sone> getSones() {
-               return new HashSet<Sone>(sones.values());
+               synchronized (sones) {
+                       return Collections.unmodifiableCollection(sones.values());
+               }
        }
 
        /**