From: David ‘Bombe’ Roden Date: Wed, 12 Sep 2012 05:47:48 +0000 (+0200) Subject: Return the currently cached own identities. X-Git-Tag: 0.8.3^2~39^2~4 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=4970a2332d0295fa4e428e1f4ea54bd2d839e464 Return the currently cached 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 8e0b124..3c3c9f9 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -19,6 +19,7 @@ package net.pterodactylus.sone.freenet.wot; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -26,8 +27,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import net.pterodactylus.sone.freenet.plugin.PluginException; -import net.pterodactylus.util.collection.mapper.Mapper; -import net.pterodactylus.util.collection.mapper.Mappers; import net.pterodactylus.util.logging.Logging; import net.pterodactylus.util.service.AbstractService; @@ -155,27 +154,7 @@ public class IdentityManager extends AbstractService { * @return All own identities */ public Set getAllOwnIdentities() { - try { - Set ownIdentities = webOfTrustConnector.loadAllOwnIdentities(); - Map newOwnIdentities = new HashMap(); - for (OwnIdentity ownIdentity : ownIdentities) { - newOwnIdentities.put(ownIdentity.getId(), ownIdentity); - } - checkOwnIdentities(newOwnIdentities); - return Mappers.mappedSet(ownIdentities, new Mapper() { - - /** - * {@inheritDoc} - */ - @Override - public OwnIdentity map(OwnIdentity input) { - return new DefaultOwnIdentity(input); - } - }); - } catch (WebOfTrustException wote1) { - logger.log(Level.WARNING, "Could not load all own identities!", wote1); - return Collections.emptySet(); - } + return new HashSet(currentOwnIdentities.values()); } //