/*
- * Sone - IdentityAccessor.java - Copyright © 2010–2013 David Roden
+ * Sone - IdentityAccessor.java - Copyright © 2010–2016 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
import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
+@Singleton
public class IdentityAccessor extends ReflectionAccessor {
/** The core. */
* @param core
* The core
*/
+ @Inject
public IdentityAccessor(Core core) {
this.core = core;
}
Identity identity = (Identity) object;
if ("uniqueNickname".equals(member)) {
int minLength = -1;
- boolean found = false;
- Set<OwnIdentity> ownIdentities = null;
- ownIdentities = core.getIdentityManager().getAllOwnIdentities();
+ boolean found;
+ Set<OwnIdentity> ownIdentities = core.getIdentityManager().getAllOwnIdentities();
do {
boolean unique = true;
String abbreviatedWantedNickname = getAbbreviatedNickname(identity, ++minLength);