From abdbf862767ed420c556669bf002960968f0090b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 11 Nov 2013 22:46:06 +0100 Subject: [PATCH] Remove sync object, simply sync on own identities. --- .../net/pterodactylus/sone/freenet/wot/IdentityManager.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java index 2933483..2459c06 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -54,12 +54,6 @@ import com.google.inject.name.Named; */ public class IdentityManager extends AbstractService { - /** Object used for synchronization. */ - @SuppressWarnings("hiding") - private final Object syncObject = new Object() { - /* inner class for better lock names. */ - }; - /** The logger. */ private static final Logger logger = Logging.getLogger(IdentityManager.class); @@ -121,7 +115,7 @@ public class IdentityManager extends AbstractService { * @return All own identities */ public Set getAllOwnIdentities() { - synchronized (syncObject) { + synchronized (currentOwnIdentities) { return new HashSet(currentOwnIdentities); } } @@ -142,7 +136,7 @@ public class IdentityManager extends AbstractService { detectChangesInIdentities(currentOwnIdentities, currentIdentities, oldIdentities); oldIdentities = currentIdentities; - synchronized (syncObject) { + synchronized (currentOwnIdentities) { this.currentOwnIdentities.clear(); this.currentOwnIdentities.addAll(currentOwnIdentities); } -- 2.7.4