ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Weighill-Smith <phil.weighill-sm...@volantis.com>
Subject Re: [Patch] style of UpToDate
Date Thu, 02 Dec 2004 16:06:09 GMT
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
> <cid:part1.02000400.06020804@apache.org>
> 
> >
> > 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 <phil.weighill-smith@volantis.com>
Volantis Systems

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message