ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craeg K. Strong" <cstr...@arielpartners.com>
Subject Re: [PATCH] Ant task inheritAll bug
Date Wed, 05 Sep 2001 02:00:45 GMT
Jason Brittain wrote:

> While reading through the Ant task source I noticed a
> bug.  The wrong variable name had been used for a
> Project object.. two were being used, one called "p1"
> and another called "project".  The line of code that
> was wrong used the wrong variable name -- it used
> "project" instead of "p1".
>
> I believe
> that this bug happened because of poor naming of
> variables combined with the lack of testing patches
> (since this is a patch to a patch that was recently
> sent in via the mailing list and committed).  If
> the variables were more clearly named, though, it
> would have been less likely for this bug to ever
> have crept in, I think.

Right on all counts, Jason!  Mea culpa-- I am the one who introduced 
this defect :-(
Your patch looks right to me.

Renaming variables is a bit tough with an established code base, but in 
general
I agree with the principle that we (the ant-dev community) should 
contribute refactorings
(design or implementation cleanups that do not change external 
functionality) as well as
bug fixes and new features.

Having a rich set of unit tests will make this lots easier and less 
risky, and that is another area
where I think we (ant-dev'ers) can contribute more...

You have reminded me to always follow my favorite process, even for 
those "tiny innocuous one line changes"

a) write a test that demonstrates the defect
b) fix the defect
c) run the test and prove that the defect no longer exists
d) submit test and patch

[Hey its never too late for new year's resolutions, right? :-]

Cheers,

--Craeg


Mime
View raw message