X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FIdentityChangeDetector.java;h=8b2801193306567aa5c41abef80e5fb366109342;hb=41ca6590c4a7372cb4f687f6e3cfdc2fab232703;hp=a8cb62b105e9e78e388ad424be3c6b6b3027bc19;hpb=4c4b77eff97fd247c6b1c8bbb30aeb6ea3d2c172;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java
index a8cb62b..8b28011 100644
--- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java
+++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java
@@ -1,5 +1,5 @@
/*
- * Sone - IdentityChangeDetector.java - Copyright © 2013 David Roden
+ * Sone - IdentityChangeDetector.java - Copyright © 2013â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
@@ -38,8 +38,6 @@ import com.google.common.collect.ImmutableMap;
* added and removed identities, and for identities that exist in both list
* their contexts and properties are checked for added, removed, or (in case of
* properties) changed values.
- *
- * @author David âBombeâ Roden
*/
public class IdentityChangeDetector {
@@ -105,7 +103,7 @@ public class IdentityChangeDetector {
return new Predicate() {
@Override
public boolean apply(Identity identity) {
- return (identity == null) ? false : identityHasChanged(oldIdentities.get(identity.getId()), identity);
+ return (identity != null) && identityHasChanged(oldIdentities.get(identity.getId()), identity);
}
};
}
@@ -142,7 +140,7 @@ public class IdentityChangeDetector {
return new Predicate() {
@Override
public boolean apply(Identity identity) {
- return identities.containsKey(identity.getId());
+ return (identity != null) && identities.containsKey(identity.getId());
}
};
}
@@ -151,7 +149,7 @@ public class IdentityChangeDetector {
return new Predicate() {
@Override
public boolean apply(String context) {
- return (identity == null) ? false : !identity.getContexts().contains(context);
+ return (identity != null) && !identity.getContexts().contains(context);
}
};
}
@@ -160,7 +158,7 @@ public class IdentityChangeDetector {
return new Predicate() {
@Override
public boolean apply(Identity identity) {
- return (identity == null) ? false : !newIdentities.contains(identity);
+ return (identity != null) && !newIdentities.contains(identity);
}
};
}
@@ -169,7 +167,7 @@ public class IdentityChangeDetector {
return new Predicate>() {
@Override
public boolean apply(Entry property) {
- return (property == null) ? false : !identity.getProperties().containsKey(property.getKey());
+ return (property != null) && !identity.getProperties().containsKey(property.getKey());
}
};
}
@@ -178,7 +176,7 @@ public class IdentityChangeDetector {
return new Predicate>() {
@Override
public boolean apply(Entry property) {
- return (property == null) ? false : !newIdentity.getProperty(property.getKey()).equals(property.getValue());
+ return (property != null) && !newIdentity.getProperty(property.getKey()).equals(property.getValue());
}
};
}