Update years in copyright line
[Sone.git] / src / main / java / net / pterodactylus / sone / freenet / wot / WebOfTrustConnector.java
index b0b6d42..ca3a38c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - WebOfTrustConnector.java - Copyright © 2010–2013 David Roden
+ * Sone - WebOfTrustConnector.java - Copyright © 2010–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 package net.pterodactylus.sone.freenet.wot;
 
 import static java.util.logging.Logger.getLogger;
+import static net.pterodactylus.sone.utils.NumberParsers.parseInt;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -30,7 +31,6 @@ import java.util.logging.Logger;
 import net.pterodactylus.sone.freenet.plugin.PluginConnector;
 import net.pterodactylus.sone.freenet.plugin.PluginException;
 import net.pterodactylus.sone.freenet.plugin.event.ReceivedReplyEvent;
-import net.pterodactylus.util.number.Numbers;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.MapMaker;
@@ -50,7 +50,7 @@ import freenet.support.api.Bucket;
 public class WebOfTrustConnector {
 
        /** The logger. */
-       private static final Logger logger = getLogger("Sone.WoT.Connector");
+       private static final Logger logger = getLogger(WebOfTrustConnector.class.getName());
 
        /** The name of the WoT plugin. */
        private static final String WOT_PLUGIN_NAME = "plugins.WebOfTrust.WebOfTrust";
@@ -126,7 +126,7 @@ public class WebOfTrustConnector {
         *             if an error occured talking to the Web of Trust plugin
         */
        public Set<Identity> loadTrustedIdentities(OwnIdentity ownIdentity) throws PluginException {
-               return loadTrustedIdentities(ownIdentity, null);
+               return loadTrustedIdentities(ownIdentity, Optional.<String>absent());
        }
 
        /**
@@ -156,9 +156,9 @@ public class WebOfTrustConnector {
                        DefaultIdentity identity = new DefaultIdentity(id, nickname, requestUri);
                        identity.setContexts(parseContexts("Contexts" + identityCounter + ".", fields));
                        identity.setProperties(parseProperties("Properties" + identityCounter + ".", fields));
-                       Integer trust = Numbers.safeParseInteger(fields.get("Trust" + identityCounter), null);
-                       int score = Numbers.safeParseInteger(fields.get("Score" + identityCounter), 0);
-                       int rank = Numbers.safeParseInteger(fields.get("Rank" + identityCounter), 0);
+                       Integer trust = parseInt(fields.get("Trust" + identityCounter), null);
+                       int score = parseInt(fields.get("Score" + identityCounter), 0);
+                       int rank = parseInt(fields.get("Rank" + identityCounter), 0);
                        identity.setTrust(ownIdentity, new Trust(trust, score, rank));
                        identities.add(identity);
                }