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:[EMAIL PROTECTED]> > > > > > Kev > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Phil Weighill-Smith <[EMAIL PROTECTED]> Volantis Systems