From dd779ac84f5ff98da5455da38a175ebc637a4623 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 10 Aug 2013 14:32:05 +0300 Subject: [PATCH] Throw NPE when toNonNull gets a null --- src/ro/ieval/fonbot/Utils.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; } -- 2.39.2