From notifications-return-5843-archive-asf-public=cust-asf.ponee.io@freemarker.apache.org Thu Jan 17 11:00:46 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E0BB2180663 for ; Thu, 17 Jan 2019 11:00:45 +0100 (CET) Received: (qmail 58297 invoked by uid 500); 17 Jan 2019 10:00:45 -0000 Mailing-List: contact notifications-help@freemarker.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.apache.org Delivered-To: mailing list notifications@freemarker.apache.org Received: (qmail 58268 invoked by uid 99); 17 Jan 2019 10:00:44 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2019 10:00:44 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 34EA88718D; Thu, 17 Jan 2019 10:00:44 +0000 (UTC) Date: Thu, 17 Jan 2019 10:00:46 +0000 To: "notifications@freemarker.apache.org" Subject: [freemarker] 02/04: _NullArgumentException.check now returns its parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: ddekany@apache.org In-Reply-To: <154771924409.28030.6050872660938840905@gitbox.apache.org> References: <154771924409.28030.6050872660938840905@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: freemarker X-Git-Refname: refs/heads/3 X-Git-Reftype: branch X-Git-Rev: c74794d34d56c775caad9e38f58216f01faa63af X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190117100044.34EA88718D@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. ddekany pushed a commit to branch 3 in repository https://gitbox.apache.org/repos/asf/freemarker.git commit c74794d34d56c775caad9e38f58216f01faa63af Author: ddekany AuthorDate: Thu Jan 17 10:57:31 2019 +0100 _NullArgumentException.check now returns its parameter --- .../org/apache/freemarker/core/util/_NullArgumentException.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freemarker-core/src/main/java/org/apache/freemarker/core/util/_NullArgumentException.java b/freemarker-core/src/main/java/org/apache/freemarker/core/util/_NullArgumentException.java index d9cdad9..5ee2eba 100644 --- a/freemarker-core/src/main/java/org/apache/freemarker/core/util/_NullArgumentException.java +++ b/freemarker-core/src/main/java/org/apache/freemarker/core/util/_NullArgumentException.java @@ -40,19 +40,21 @@ public class _NullArgumentException extends IllegalArgumentException { /** * Convenience method to protect against a {@code null} argument. */ - public static void check(String argumentName, Object argumentValue) { + public static T check(String argumentName, T argumentValue) { if (argumentValue == null) { throw new _NullArgumentException(argumentName); } + return argumentValue; } /** * Convenience method to protect against a {@code null} argument. */ - public static void check(Object argumentValue) { + public static T check(T argumentValue) { if (argumentValue == null) { throw new _NullArgumentException(); } + return argumentValue; } }