X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FIdentityManagerImpl.java;h=6f46465e02793e64ec174849787f309dabbd4907;hb=226695fb3e52bf6c58203d9d73ac8436a5414ec2;hp=3946c049327fc889e65d704c6b8bcf41e2755d24;hpb=4469a8def6097375442a98576e07b7405e3acce3;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.java
index 3946c04..6f46465 100644
--- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.java
+++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Sone - IdentityManager.java - Copyright © 2010â2013 David Roden
+ * Sone - IdentityManagerImpl.java - Copyright © 2010â2019 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
@@ -17,6 +17,8 @@
package net.pterodactylus.sone.freenet.wot;
+import static java.util.logging.Logger.getLogger;
+
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -26,12 +28,12 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import net.pterodactylus.sone.freenet.plugin.PluginException;
-import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.service.AbstractService;
import com.google.common.collect.Sets;
import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
+import com.google.inject.Singleton;
/**
* The identity manager takes care of loading and storing identities, their
@@ -41,13 +43,12 @@ import com.google.inject.Inject;
* It is also responsible for polling identities from the Web of Trust plugin
* and sending events to the {@link EventBus} when {@link Identity}s and
* {@link OwnIdentity}s are discovered or disappearing.
- *
- * @author David âBombeâ Roden
*/
+@Singleton
public class IdentityManagerImpl extends AbstractService implements IdentityManager {
/** The logger. */
- private static final Logger logger = Logging.getLogger(IdentityManagerImpl.class);
+ private static final Logger logger = getLogger(IdentityManagerImpl.class.getName());
/** The event bus. */
private final EventBus eventBus;
@@ -106,7 +107,7 @@ public class IdentityManagerImpl extends AbstractService implements IdentityMana
@Override
public Set getAllOwnIdentities() {
synchronized (currentOwnIdentities) {
- return new HashSet(currentOwnIdentities);
+ return new HashSet<>(currentOwnIdentities);
}
}
@@ -119,7 +120,7 @@ public class IdentityManagerImpl extends AbstractService implements IdentityMana
*/
@Override
protected void serviceRun() {
- Map> oldIdentities = new HashMap>();
+ Map> oldIdentities = new HashMap<>();
while (!shouldStop()) {
try {