From: David ‘Bombe’ Roden Date: Fri, 1 Apr 2011 10:34:37 +0000 (+0200) Subject: Add validation. X-Git-Tag: 0.6^2~30 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=72d3ab65d4d28b31bf0f422fd85e4387487f8b7b;p=Sone.git Add validation. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 7545d98..5a91f79 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -525,6 +525,7 @@ public class Core implements IdentityListener, UpdateListener { * @return {@code true} if the target Sone is trusted by the origin Sone */ public boolean isSoneTrusted(Sone origin, Sone target) { + Validation.begin().isNotNull("Origin", origin).isNotNull("Target", target).check().isInstanceOf("Origin’s OwnIdentity", origin.getIdentity(), OwnIdentity.class).check(); return trustedIdentities.containsKey(origin.getIdentity()) && trustedIdentities.get(origin.getIdentity()).contains(target.getIdentity()); }