projects
/
WoTNS.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove warning.
[WoTNS.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
wotns
/
main
/
Resolver.java
diff --git
a/src/main/java/net/pterodactylus/wotns/main/Resolver.java
b/src/main/java/net/pterodactylus/wotns/main/Resolver.java
index
0150f45
..
12eff7e
100644
(file)
--- a/
src/main/java/net/pterodactylus/wotns/main/Resolver.java
+++ b/
src/main/java/net/pterodactylus/wotns/main/Resolver.java
@@
-23,7
+23,10
@@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.object.Default;
import net.pterodactylus.wotns.freenet.wot.Identity;
import net.pterodactylus.wotns.freenet.wot.IdentityManager;
import net.pterodactylus.util.object.Default;
import net.pterodactylus.wotns.freenet.wot.Identity;
import net.pterodactylus.wotns.freenet.wot.IdentityManager;
@@
-38,6
+41,8
@@
import freenet.keys.FreenetURI;
*/
public class Resolver {
*/
public class Resolver {
+ private static final Logger logger = Logging.getLogger(Resolver.class);
+
private final IdentityManager identityManager;
private String ownIdentityId;
private final IdentityManager identityManager;
private String ownIdentityId;
@@
-85,9
+90,10
@@
public class Resolver {
identityName = shortName.substring(0, atSign);
keyStart = shortName.substring(atSign + 1);
}
identityName = shortName.substring(0, atSign);
keyStart = shortName.substring(atSign + 1);
}
- @SuppressWarnings("hiding")
final OwnIdentity ownIdentity;
final OwnIdentity ownIdentity;
- if (this.ownIdentityId == null) {
+ if ((this.ownIdentityId != null) && (identityManager.getOwnIdentity(this.ownIdentityId) != null)) {
+ ownIdentity = identityManager.getOwnIdentity(this.ownIdentityId);
+ } else if (this.ownIdentityId == null) {
Set<OwnIdentity> ownIdentities = identityManager.getAllOwnIdentities();
if (!ownIdentities.isEmpty()) {
ownIdentity = ownIdentities.iterator().next();
Set<OwnIdentity> ownIdentities = identityManager.getAllOwnIdentities();
if (!ownIdentities.isEmpty()) {
ownIdentity = ownIdentities.iterator().next();
@@
-95,7
+101,8
@@
public class Resolver {
ownIdentity = null;
}
} else {
ownIdentity = null;
}
} else {
- ownIdentity = identityManager.getOwnIdentity(ownIdentityId);
+ logger.log(Level.SEVERE, "Can not resolve “" + shortName + "” without a Web of Trust Identity!");
+ ownIdentity = null;
}
if (ownIdentity == null) {
return null;
}
if (ownIdentity == null) {
return null;