Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDFCB108B6 for ; Fri, 20 Feb 2015 10:05:52 +0000 (UTC) Received: (qmail 1414 invoked by uid 500); 20 Feb 2015 10:05:52 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 1372 invoked by uid 500); 20 Feb 2015 10:05:52 -0000 Mailing-List: contact dev-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list dev@ignite.incubator.apache.org Received: (qmail 1360 invoked by uid 99); 20 Feb 2015 10:05:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2015 10:05:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sergi.vladykin@gmail.com designates 209.85.213.177 as permitted sender) Received: from [209.85.213.177] (HELO mail-ig0-f177.google.com) (209.85.213.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2015 10:05:27 +0000 Received: by mail-ig0-f177.google.com with SMTP id z20so1922602igj.4 for ; Fri, 20 Feb 2015 02:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=S/WjHYORm/kGL+vDMVTStphpRT/J8lC3MPPJex5puIM=; b=sd4R0mgtdqXzHpYGugDa47J+6WY+qCLqbaZYcrPHHKLRvExrOjBBJHTCv+lM+e1ZfK zQqM18h5MPtAzCpNa8j6jcRjwVQztw186aeqtItQcc0v4N9imJXvY+HYF4jthEbj2IAK YiVmfIRpcUdgCAuzGhmfYXWv7yrNvznIUJXd+mqkQfvI9ytUneAK/ElNQ4ly5VbZ3ANy n0uf/zoR9UtVGG0TRwtwdH1ZZDMeLYppcKIUGgrrrIF01QKUGE9e9WLWQLM63YRFJC7b d9p4/605O58OeL/0Sv8j74RYwfUzj6ICZ+sMwYFDNDLcLGBgiV0A/yx3/QAWvJzfwhQ+ dC5Q== X-Received: by 10.50.129.9 with SMTP id ns9mr13162936igb.24.1424426680178; Fri, 20 Feb 2015 02:04:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.166.7 with HTTP; Fri, 20 Feb 2015 02:04:00 -0800 (PST) In-Reply-To: <20150220010643.GD4732@boudnik.org> References: <20150209050202.GK4732@boudnik.org> <20150220010643.GD4732@boudnik.org> From: Sergi Vladykin Date: Fri, 20 Feb 2015 14:04:00 +0400 Message-ID: Subject: Re: use of @Nullable To: dev@ignite.incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b343c9c47e0e7050f822e23 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343c9c47e0e7050f822e23 Content-Type: text/plain; charset=UTF-8 I don't think these annotation will make development easier. It will only require additional efforts to support these annotations in actual state on each method. But they will not replace unit testing. I'd prefer not using them at all if the choice is between all and nothing. Sergi 2015-02-20 4:06 GMT+03:00 Konstantin Boudnik : > I think it's a great idea. But that's just my uneducated opinion. > > On Thu, Feb 19, 2015 at 02:51PM, Sergey Evdokimov wrote: > > It's a wrong usage of @Nullable annotation, Ignite.jcache("mycache") must > > NOT be marked as @Nullable , because we does not want to force > > null-checking by user. A good place for @Nullable annotation > > java.io.BufferedReader#readLine() method. Feel the difference. > > > > > I think that having annotations only on public API is ok. @NotNull and > > > @Contract seem to be extra effort. > > Why public only? Marking parameters in private code will make development > > easier for us. > > > > If you are agree I suggest to create a ticket. > > > > On Wed, Feb 18, 2015 at 6:54 PM, Dmitriy Setrakyan < > dsetrakyan@apache.org> > > wrote: > > > > > My problem is IDEA warnings. For example, Ignite.jcache("mycache") may > > > return null, and if I don't check for null, IDEA gives an warning. In > 99% > > > of the cases here I don't need to check of null because I know that > cache > > > is there. > > > > > > D. > > > > > > On Wed, Feb 18, 2015 at 7:00 AM, Sergi Vladykin < > sergi.vladykin@gmail.com> > > > wrote: > > > > > > > I think that having annotations only on public API is ok. @NotNull > and > > > > @Contract seem to be extra effort. > > > > > > > > Sergi > > > > > > > > 2015-02-09 9:33 GMT+03:00 Dmitriy Setrakyan : > > > > > > > > > I generally found myself suppressing IDE warnings whenever these > > > > > annotations are used. Personally, I would not, but I would want to > hear > > > > > what others think as well. > > > > > > > > > > D. > > > > > > > > > > On Sun, Feb 8, 2015 at 10:29 PM, Sergey Evdokimov < > > > > sevdokimov@gridgain.com > > > > > > > > > > > wrote: > > > > > > > > > > > Whats about @NotNull and @Contract annotations? Can we use its > in our > > > > > code? > > > > > > > > > > > > On Mon, Feb 9, 2015 at 8:02 AM, Konstantin Boudnik < > cos@apache.org> > > > > > wrote: > > > > > > > > > > > > > Sounds like a good idea. In my experience having @Nullable for > > > > returns > > > > > > is a > > > > > > > good thing, as it quickly let a user of the API to see what's > the > > > > > > contract. > > > > > > > > > > > > > > Cos > > > > > > > > > > > > > > On Sun, Feb 08, 2015 at 04:36PM, Dmitriy Setrakyan wrote: > > > > > > > > Hi Igniters, > > > > > > > > > > > > > > > > I want to revisit the use of the @Nullable annotation within > the > > > > > > project. > > > > > > > > What I am noticing more and more, is that @Nullable > annotation > > > just > > > > > > > causes > > > > > > > > extra warnings in IDE, especially on public API, causing > most of > > > > the > > > > > > > users > > > > > > > > and developers to disable it. > > > > > > > > > > > > > > > > I want to propose the following policy: > > > > > > > > - Use @Nullable for method parameters on public API for > > > > documentation > > > > > > > > purposes. > > > > > > > > - Do not use @Nullable for return types on public API to > avoid > > > > > > > unnecessary > > > > > > > > warnings. > > > > > > > > - Do not use @Nullable within internal implementation logic > to > > > > avoid > > > > > > > > unnecessary clutter in code. > > > > > > > > > > > > > > > > Thoughts? > > > > > > > > > > > > > > > > D. > > > > > > > > > > > > > > > > > > > > > > > > > > --047d7b343c9c47e0e7050f822e23--