Don’t suppress warnings.
[WoTNS.git] / src / main / java / net / pterodactylus / wotns / freenet / wot / IdentityManager.java
index ea90dac..5a53106 100644 (file)
@@ -182,8 +182,10 @@ public class IdentityManager extends AbstractService {
         */
        public Set<Identity> getTrustedIdentities(OwnIdentity ownIdentity) {
                Set<Identity> identities = new HashSet<Identity>();
-               if ((context == null) || ownIdentity.getContexts().contains(context)) {
-                       identities.add(ownIdentity);
+               for (OwnIdentity additionalOwnIdentity : getAllOwnIdentities()) {
+                       if ((context == null) || additionalOwnIdentity.getContexts().contains(context)) {
+                               identities.add(additionalOwnIdentity);
+                       }
                }
                try {
                        Set<Identity> trustedIdentities = webOfTrustConnector.loadTrustedIdentities(ownIdentity, context);
@@ -192,6 +194,7 @@ public class IdentityManager extends AbstractService {
                                newTrustedIdentities.put(trustedIdentity.getId(), trustedIdentity);
                        }
                        checkTrustedIdentities(ownIdentity, newTrustedIdentities);
+                       identities.addAll(trustedIdentities);
                } catch (WebOfTrustException wote1) {
                        logger.log(Level.WARNING, String.format("Could not load all trusted identities for %s.", ownIdentity), wote1);
                }
@@ -209,7 +212,6 @@ public class IdentityManager extends AbstractService {
        protected void serviceRun() {
                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;
@@ -311,7 +313,6 @@ public class IdentityManager extends AbstractService {
         */
        private void checkTrustedIdentities(OwnIdentity ownIdentity, Map<String, Identity> trustedIdentities) {
 
-               @SuppressWarnings("hiding")
                Map<String, Identity> currentTrustedIdentities = new HashMap<String, Identity>();
                synchronized (syncObject) {
                        if (this.currentTrustedIdentities.containsKey(ownIdentity)) {