From: David ‘Bombe’ Roden Date: Fri, 6 May 2011 21:34:00 +0000 (+0200) Subject: Use a boolean instead of abusing ownIdentities. X-Git-Tag: 0.6.4^2~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=176d7c668f93943ebe8a207f4ac990d855314109;p=Sone.git Use a boolean instead of abusing ownIdentities. --- 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 acd8633..3c97e55 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -181,6 +181,7 @@ public class IdentityManager extends AbstractService { Map currentOwnIdentities = new HashMap(); Set ownIdentities = null; + boolean identitiesLoaded = false; try { /* get all identities with the wanted context from WoT. */ ownIdentities = webOfTrustConnector.loadAllOwnIdentities(); @@ -199,12 +200,12 @@ public class IdentityManager extends AbstractService { identities.put(identity.getId(), identity); } } + identitiesLoaded = true; } catch (WebOfTrustException wote1) { logger.log(Level.WARNING, "WoT has disappeared!", wote1); - ownIdentities = null; } - if (ownIdentities != null) { + if (identitiesLoaded) { /* check for changes. */ checkOwnIdentities(currentOwnIdentities);