Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 63706 invoked from network); 2 Dec 2004 16:06:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 16:06:20 -0000 Received: (qmail 16724 invoked by uid 500); 2 Dec 2004 16:06:16 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 16674 invoked by uid 500); 2 Dec 2004 16:06:16 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 16644 invoked by uid 99); 2 Dec 2004 16:06:16 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp.volantis.com (HELO mail.volantis.com) (213.86.197.2) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 08:06:14 -0800 Received: squid 10.20.30.27 from 10.20.30.23 10.20.30.23 via HTTP with MS-WebStorage 6.0.6249 Received: from sparrow.uk.volantis.com by squid; 02 Dec 2004 16:06:09 +0000 Subject: Re: [Patch] style of UpToDate From: Phil Weighill-Smith To: Ant Developers List In-Reply-To: <41AF3AA2.1070203@apache.org> References: <41AEE4A3.2030605@it.fts-vn.com> <41AF0345.9010809@apache.org> <41AF0841.3090600@it.fts-vn.com> <41AF3AA2.1070203@apache.org> Content-Type: multipart/alternative; boundary="=-Zn8zIDm3OCLLsVFajBym" Organization: Volantis Systems Message-Id: <1102003569.10917.10.camel@sparrow.uk.volantis.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 02 Dec 2004 16:06:09 +0000 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=-Zn8zIDm3OCLLsVFajBym Content-Type: text/plain Content-Transfer-Encoding: 7bit I personally think the use of "final" for method parameters is "a good thing" - it reminds me of that great C++ feature "const" (which was actually far more sophisticated and useful, and strangely is a Java reserved keyword). Just because people haven't previously adopted a practice doesn't mean that it can't become best practice; this is a definite candidate for the latter. Phil :n. On Thu, 2004-12-02 at 15:54, Peter Reilly wrote: > Kevin Jackson wrote: > > > Peter Reilly wrote: > > > >> Kevin Jackson wrote: > >> > >>> Just removed the C++ style private variables > >> > >> > >> > >> cool, but... > >> 1) why place a "final" in the arguments > >> 2) you should only use the "this." in the setter > > > > > > 1) I was reading hardcore java - www.oreilly.com/catalog/*hardcore*jv/ > > > > The arguments made in favour of declaring variables to methods as > > final far outweighed (in my mind), the hassle of typing a few extra > > characters. The chapter on final being used in this (and a variety of > > other manners) is available as a pdf and I thoroughly recommend > > reading it, just to see what you think, but I couldn't disagree with > > his reasoning. > > Mmmm..... > declaring method parameters as final may reduce a number of silly bugs, > however I cannot think of any > bugs in the ant code that has been caused by setting method parameters. > It is not normal java style to use > final method parameters and it > is not normal ant coding style (although some of Magesh's code does do > this).** > > > > > 2) yeah, sorry, I got carried away I think - in other methods there > > should be no need to use this - doh! > > > > The main reason I did this was that I've been trying to contribute for > > the last few days and I haven't found anything that I felt I had the > > time to start on and this looked like a quick contribution, > > An ongoing project is making the ant source code pass a checkstyle > audit. There is check.xml at the top level in the ant source code. > The top offending files are the moment are: > > taskdefs/Rmic.java > taskdefs/Zip.java > taskdefs/optional/vss/MSVSS.java > taskdefs/optional/javacc/JavaCC.java > taskdefs/optional/NetRexxC.java > taskdefs/optional/junit/JUnitTestRunner.java > types/Path.java > taskdefs/repository/Library.java > taskdefs/optional/jsp/JspC.java > > Peter > > > > > > Kev > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > > For additional commands, e-mail: dev-help@ant.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org -- Phil Weighill-Smith Volantis Systems --=-Zn8zIDm3OCLLsVFajBym--