From: Marius Gavrilescu Date: Sat, 10 Aug 2013 11:32:05 +0000 (+0300) Subject: Throw NPE when toNonNull gets a null X-Git-Tag: 0.000_001~6 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=dd779ac84f5ff98da5455da38a175ebc637a4623;p=fonbot.git Throw NPE when toNonNull gets a null --- diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index 9a23d04..ce275fa 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -190,10 +190,8 @@ public final class Utils { * @throws AssertionError if the given object is null */ public static T toNonNull(@Nullable T object) throws AssertionError{ - if(object==null){ - Log.wtf(Utils.class.getName(), "toNonNull called with null"); - throw new AssertionError("Log.wtf did not terminate the process"); - } + if(object==null) + throw new NullPointerException(); return object; }