From 3c8d2fc3f4b11f8ccd7fcce6339ba1a34c055ac5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 29 Jan 2013 06:43:24 +0100 Subject: [PATCH] Fix synchronization. --- src/main/java/net/pterodactylus/sone/core/Core.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()); + } } /** -- 2.7.4