Return-Path: X-Original-To: apmail-maven-dev-archive@www.apache.org Delivered-To: apmail-maven-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9278717A92 for ; Sun, 26 Oct 2014 09:17:43 +0000 (UTC) Received: (qmail 74712 invoked by uid 500); 26 Oct 2014 09:17:43 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 74626 invoked by uid 500); 26 Oct 2014 09:17:43 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 74614 invoked by uid 99); 26 Oct 2014 09:17:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Oct 2014 09:17:42 +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 dennisl.apache@gmail.com designates 209.85.192.170 as permitted sender) Received: from [209.85.192.170] (HELO mail-pd0-f170.google.com) (209.85.192.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Oct 2014 09:17:15 +0000 Received: by mail-pd0-f170.google.com with SMTP id z10so3885967pdj.1 for ; Sun, 26 Oct 2014 02:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=k/VOKZX0Er3h8QF3Y8muN8qHSJOLC4AkjD4dklahLMQ=; b=efTVbUCoGV0b1qkSYa4XIOL8aXivrQvA+OQhDcDH+b+9ak7I506AhouFScWgHbANwx u3OuwGWL51ni8MeDtWzt29vW/553Hta3bsmb4gtRS6vw2xj8kZ7JIr4ljz0aa8IZ4gUW npYLScFi4Bxc00SLAbV55fMPhLq1MLdrZx/lV1ltSVYEiIaX0n3V62cOjRjXlG60tR3U aZsDgQNn4fpfKx0I74n64DE6uI2tborBkP89oQ6i4dcyaSEyQlJwQviY31ZtaYeMR5wn nmpNN8DHRUszhzhLfFASH940B6gy4unQGq07Uz5SRuVGajsL35sp8kR1hbHy6b4r59bM 49mQ== MIME-Version: 1.0 X-Received: by 10.66.244.137 with SMTP id xg9mr2337282pac.113.1414315033850; Sun, 26 Oct 2014 02:17:13 -0700 (PDT) Sender: dennisl.apache@gmail.com Received: by 10.70.125.198 with HTTP; Sun, 26 Oct 2014 02:17:13 -0700 (PDT) Received: by 10.70.125.198 with HTTP; Sun, 26 Oct 2014 02:17:13 -0700 (PDT) In-Reply-To: References: <20141010163527.6CF552388993@eris.apache.org> <2374233.Qz7M4zpVy7@herve-desktop> <1421860.PuR5VvIDjY@herve-desktop> Date: Sun, 26 Oct 2014 10:17:13 +0100 X-Google-Sender-Auth: nA6sLJ3ZyhdhfU4YIIq0GCVzERw Message-ID: Subject: Re: errors reported by Checkstyle From: Dennis Lundberg To: Maven Developers List Content-Type: multipart/alternative; boundary=047d7b15aaaf317a3405064fe157 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b15aaaf317a3405064fe157 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, My personal preference is to have all annotations first, i.e. before the visibility modifier. I checked the JLS, but couldn't find any recommendation. The examples in chapter 9.7 use the order that Checkstyle suggests. -- Dennis Lundberg Den 25 okt 2014 20:38 skrev "Andreas Gudian" : > I've started switching on maven-parent 25 in surefire now and I see > literary hundreds of checkstyle errors (I ignore the warnings for now). > Most of the stuff is fine with me and I'm on fixing them for a couple of > days already. > > But there's one thing that struck me and that I'm a bit reluctant to chan= ge > - and I'd like your opinion on it. > > We have for example this method: > private @Nonnull List getExcluded() ... > > Checkstyle now tells me that the @Nonnull should preceed the private > modifier: > > @Nonnull private List getExcluded() ... > > Especially as Java 8 introduced the notion of annotated type declarations > (as in @Nonnull String myNeverNullVariable; ), I think that this particul= ar > @Nonnull annotation should be right in front of the return type and not > before the visibility modifier. > > The message is thrown by the ModifierOrder check (which does other good > things) and that one can't be configured to behave differently. > > So now I'd have to specifically ignore that warning on each method for > which we qualify the return type with @Nonnull / @Nullable. > > What's you pick on this? Is the form suggested by checkstyle really to be > preferred? I'd open an issue for them if you also think that it might nee= d > some tweaking. > > Thanks, > Andreas > > > > 2014-10-14 8:34 GMT+02:00 Herv=C3=A9 BOUTEMY : > > > Le mardi 14 octobre 2014 09:28:21 Olivier Lamy a =C3=A9crit : > > > On 14 October 2014 05:01, Herv=C3=A9 BOUTEMY = wrote: > > > > 2. if we configured Checkstyle to report an error, this means check > > should > > > > fail: if you find that it should not fail, please help improve > > Checkstyle > > > > configuration by setting severity to warning only > > > > > > /me not a checkstyle expert configuration :-) > > this makes me remember there is a feature improvement for m-checkstyle-= p > > 2.13 > > that I should explain: I was not a Checkstyle configuration master and > felt > > like you > > Than I consistently reported Checkstyle rule name and category in every > > message and report, and a link to Checkstyle documentation for each rul= e > > [1] > > > > this gives a good intro to Checkstyle configuration and help a lot when > > needing > > to @SuppressWarnings( "checkstyle:name of rule, in lowercase") > > > > > /me asking himself if having such hard checkstyle requirement help to > > > improve user experience. > > from my perspective, previous feature really improved m-checkstyle-p > > experience > > and I know I should submit patches to Checkstyle itself, because I thin= k > > this > > could help their users too when using bare-Checkstyle > > > > Regards, > > > > Herv=C3=A9 > > > > > > [1] > > http://maven.apache.org/plugins/maven-checkstyle-plugin/checkstyle.html > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org > > For additional commands, e-mail: dev-help@maven.apache.org > > > > > --047d7b15aaaf317a3405064fe157--