Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: null checks Date: Fri, 7 Jul 2017 11:49:43 -0400 Organization: Aioe.org NNTP Server Lines: 23 Message-ID: References: NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:36815 On 7/7/2017 11:03 AM, Eric Douglas wrote: > Correct me if I'm wrong but the NonNull is pointless? > > https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_null_type_annotations.htm > > We should just use the null check? > > https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#requireNonNull-T- I am not sure that I understand the question. Annotations can be used by compilers or check tools to issue warnings/errors and by AOP tools to insert runtime checks automatically. A runtime check is just a piece of code that does a runtime check. Two completely different purposes. Arne