Suppress some warnings about variables hiding other variables.
[Sone.git] / src / main / java / net / pterodactylus / sone / freenet / wot / IdentityManager.java
index acd8633..803bc32 100644 (file)
@@ -178,9 +178,11 @@ public class IdentityManager extends AbstractService {
                Map<OwnIdentity, Map<String, Identity>> oldIdentities = Collections.emptyMap();
                while (!shouldStop()) {
                        Map<OwnIdentity, Map<String, Identity>> currentIdentities = new HashMap<OwnIdentity, Map<String, Identity>>();
+                       @SuppressWarnings("hiding")
                        Map<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
 
                        Set<OwnIdentity> ownIdentities = null;
+                       boolean identitiesLoaded = false;
                        try {
                                /* get all identities with the wanted context from WoT. */
                                ownIdentities = webOfTrustConnector.loadAllOwnIdentities();
@@ -199,12 +201,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);