From 782094688a0ad5d9de242fc79bd6cc255f611ead Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 6 Jan 2017 20:26:28 +0100 Subject: [PATCH] Simplify ternary operator expressions --- .../pterodactylus/sone/freenet/wot/IdentityChangeDetector.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 cfce632..f014de5 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetector.java @@ -105,7 +105,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 +151,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 +160,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 +169,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 +178,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()); } }; } -- 2.7.4