From: David ‘Bombe’ Roden Date: Mon, 11 Nov 2013 21:46:06 +0000 (+0100) Subject: Remove sync object, simply sync on own identities. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=abdbf862767ed420c556669bf002960968f0090b;p=Sone.git Remove sync object, simply sync on own identities. --- 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); }