From: David ‘Bombe’ Roden Date: Tue, 29 Jan 2013 05:43:24 +0000 (+0100) Subject: Fix synchronization. X-Git-Tag: 0.8.5^2~3^2~30 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3c8d2fc3f4b11f8ccd7fcce6339ba1a34c055ac5;p=Sone.git Fix synchronization. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index cdb7feb..4d39c10 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -352,7 +352,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, * @return All Sones */ public Set getSones() { - return new HashSet(sones.values()); + synchronized (sones) { + return Collections.unmodifiableCollection(sones.values()); + } } /**