X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FIdentityChangeDetector.java;h=dd02b2f077b36673748370096032894f16f737cf;hp=2fe10df7232f7c1bbae22d98b95837121dfc4fbe;hb=62573c314957b1851f4fbe693b8746686caa940a;hpb=647c57e2e15fc11cc63a270adb27eb59a5f629ff 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 2fe10df..dd02b2f 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–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 @@ -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); } }; } @@ -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()); } }; }