Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-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 AB335D042 for ; Mon, 3 Sep 2012 21:19:32 +0000 (UTC) Received: (qmail 76306 invoked by uid 500); 3 Sep 2012 21:19:32 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 76125 invoked by uid 500); 3 Sep 2012 21:19:32 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 76114 invoked by uid 99); 3 Sep 2012 21:19:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 21:19:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phil.steitz@gmail.com designates 209.85.210.43 as permitted sender) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 21:19:26 +0000 Received: by daku36 with SMTP id u36so4609919dak.30 for ; Mon, 03 Sep 2012 14:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; bh=4xB9vaLPvP993ick0eK/n+tYqwByafwYRum4+0Shdkg=; b=w2XSVjRMM2r3Gw0iQNCITKVbB8XIa16vYibcMFHPH1qjqJGi3jZLBmFzhKeGNii656 jhnbEUTy0qQQltFhpqTkx+nRaHIcqkt7WbvD4JBb6FS6R/uMcv24eQ/JcmY0ZNAHwzl2 WjoGpKTOi8x6oPwChJDgs2mGF4SSg1+6XjSmaXOE7BfT5YDIYrfIGCzFllPnbf0qjl1K zMccMHiRY0lutDznzwLOBdFAQwbKmGlNNK/K2MUYr7fPT9mxAm0I7fjTy7LIHY8ZdSdL 2htLps5FCXziGoYXx1BuwLHARXOFxA5AQi4jLGgwFc3C8jnjtibsga94wJzT8SkB2Sia EGcQ== Received: by 10.68.138.166 with SMTP id qr6mr40644713pbb.69.1346707146302; Mon, 03 Sep 2012 14:19:06 -0700 (PDT) Received: from [10.251.18.40] (174-17-43-221.phnx.qwest.net. [174.17.43.221]) by mx.google.com with ESMTPS id st6sm10613845pbc.58.2012.09.03.14.19.03 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Sep 2012 14:19:05 -0700 (PDT) Subject: Re: [all] Checkstyle and '+' should be on the previous line. References: <5044E20B.3030906@gmail.com> <20120903181241.GV24856@dusk.harfang.homelinux.org> <-8855494391074056089@unknownmsgid> From: Phil Steitz Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (9B206) In-Reply-To: <-8855494391074056089@unknownmsgid> Message-Id: <68584836-6630-4338-8F12-6C0534D1764D@gmail.com> Date: Mon, 3 Sep 2012 14:19:01 -0700 To: Commons Developers List Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Virus-Checked: Checked by ClamAV on apache.org On Sep 3, 2012, at 12:25 PM, Gary Gregory wrote: > On Sep 3, 2012, at 14:13, Gilles Sadowski w= rote: >=20 >> On Mon, Sep 03, 2012 at 09:59:55AM -0700, Phil Steitz wrote: >>> On 9/1/12 10:11 AM, Gary Gregory wrote: >>>=20 >>> I have not tried using it, but the eclipse config that Luc posted >>> [1] includes this line, which I suspect configures this behavior: >>>=20 >>> >> id=3D"org.eclipse.jdt.core.formatter.wrap_before_binary_operator" >>> value=3D"false"/> >>>=20 >>> I am curious why you don't like it. To me, it is similar to putting >>> the open paren for a method call on the preceding line. Easier to >>> read for me at least. Of course, in keeping with my normal "too >>> many rules =3D=3D evil" view, I don't see it as something that needs to >>> be standardized :) >>=20 >> One way to "explain" it: You would not write unary minus on the previous >> line: >> double minusOne =3D - >> 1; >=20 > That makes sense for unary guys at least. >=20 Sort of ridiculous example, as the - would never be followed by a space, so w= ould never be wrapped that way. The rule above and I suspect the checkstyle= check, refers to binary operators.=20 Phil > G >=20 >>=20 >> Similarly, before one has become used to this (arbitrary) rule, this is a= s >> strange: >> double xMinusOne =3D x - >> 1; >>=20 >> [A rationale for writing parenthesis on the same line is that you can fig= ure >> out more quickly that it is a method call, rather than a reference to a >> variable.] >>=20 >>=20 >> Gilles >>=20 >>>=20 >>> Phil >>>=20 >>> [1] http://markmail.org/message/djnlefeodk2xa7bz >>>=20 >>>> Hi All: >>>>=20 >>>> Checkstyle can report warnings like: >>>>=20 >>>> '+' should be on the previous line. >>>>=20 >>>> FWIW, I'm not fond of this particular checkstyle rule. >>>>=20 >>>> Does anyone know if the Eclipse formatter can be made to behave like th= is? >>>> I've not found such setting in the giant formatter options dialog. I am= on >>>> Eclipse 3.7.2. Are there any 4.x users out there? If so, does 4.x deal w= ith >>>> this? >>>>=20 >>>> Thank you, >>>> Gary >>>>=20 >>>=20 >>>=20 >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >>=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org