Return-Path: X-Original-To: apmail-incubator-jspwiki-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-jspwiki-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 967931043E for ; Fri, 19 Jul 2013 21:36:08 +0000 (UTC) Received: (qmail 59593 invoked by uid 500); 19 Jul 2013 21:36:08 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 59577 invoked by uid 500); 19 Jul 2013 21:36:08 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 59569 invoked by uid 99); 19 Jul 2013 21:36:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 21:36:08 +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 glen.mazza@gmail.com designates 209.85.128.45 as permitted sender) Received: from [209.85.128.45] (HELO mail-qe0-f45.google.com) (209.85.128.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 21:36:03 +0000 Received: by mail-qe0-f45.google.com with SMTP id w7so2670564qeb.32 for ; Fri, 19 Jul 2013 14:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=r781MpvF82QjY9KFanT59R4WR6zmWwhw+eFxI1xpyDM=; b=cv4qt+IN4EqUtdicTXEYb6Hg4/WLCMODln1WnTuIQCSKdbK+K7X6EHjUCMUSZoYGEA 9ZdF5PS4VGCsKAeHsbY57u/XbiE2n39sc1yEoMQlYGodl0bVtLobQn/eqjRrLwA5zvML Xbf8E/wDXFYiDOKoyl8MZOVaZKZr9s7pjstZ1yxtUb1+pdjNBBlJooRHHqqftXgeoSgq Jh2OcJfz6kUlRLF+AZ6yUwGkq9o0g9ENVjM8L8fTuP9V/3nuGfvmMKTRsd8A7cCUbnya XRrfOrvSuJW6bJhGONjgkaQdq9q/YsrC/g6Z4oveLOjpU/Da0J9g1q1nb6fnG+YFtrcV 1ysA== X-Received: by 10.224.103.138 with SMTP id k10mr20228616qao.42.1374269742974; Fri, 19 Jul 2013 14:35:42 -0700 (PDT) Received: from [192.168.1.46] (pool-74-96-48-24.washdc.east.verizon.net. [74.96.48.24]) by mx.google.com with ESMTPSA id b4sm25105387qas.3.2013.07.19.14.35.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Jul 2013 14:35:42 -0700 (PDT) Message-ID: <51E9B12D.7070506@gmail.com> Date: Fri, 19 Jul 2013 17:35:41 -0400 From: Glen Mazza User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: jspwiki-dev@incubator.apache.org Subject: Switching to different bracing style? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Team, the next Sonar complaint, and there's a significant 500 of them within JSPWiki, is that we're not using braces for single-line if/while/for loops. I know for CXF braces are always required, and I suspect the majority of Apache projects today also disallow them, so the requirement is not unreasonable. Fixing them is not the problem, what *is* the problem is our older-fashioned bracing system, i.e., instead of switching from this Style A: if (a > b) c = 10; else if (d > e) f = 20; to this (the bracing system JSPWiki presently uses): Style B: if (a > b) { c = 10; } else if (d > e) { f = 20; } I'd like to be doing this instead: Style C: if (a > b) { c = 10; } else if (d > e) { f = 20; } I've checked five major open source projects -- Style C is all they use: CXF - http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/https/CertConstraintsFeature.java?revision=828758&view=markup Camel - http://svn.apache.org/viewvc/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java?revision=1190212&view=markup Tomcat - http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/FilterBase.java?revision=1189413&view=markup Hadoop - http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalDistributedCacheManager.java?revision=1466196&view=markup Spring Framework: https://github.com/SpringSource/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/object/SqlFunction.java Style B might be OK for projects that still allow Style A, but it makes the code too bloated once Style A is disallowed. I don't think we'll be able to attract many committers sticking with Style B anymore. Basically, to avoid the busywork of converting Style B to Style C, we'll allow either in our source code but with the expectation that more and more code will be adopting Style C as time moves on, how does that sound? (Or, do we want to continue with allowing Style A and Style B?--we're welcome to ignore Sonar on this.) Regards, Glen