ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <kevin.jack...@it.fts-vn.com>
Subject Re: [patch] javadoc, name-hiding, if/else nesting
Date Wed, 13 Apr 2005 01:58:52 GMT

> if (condition)
> {
>    return a;
> }
> return b;
>
> over:
>
> if (condition)
> {
>    return a;
> } else {
>    return b;
> }
>

Only real benefit is to get rid of compiler warnings.  I'm ambivalent 
about either way being "more correct", but the fewer warnings I get the 
better IMHO, so I remove nesting of returns in else statements.  I 
personally think that explicitly putting the else clause in helps 
legibility, but it's extra useless braces and it's unneccessary from teh 
compilers perspective.  I always try to keep the compiler happy :)

> so I didn't apply those patches.
>
No worries

> I did apply the destDir -> baseDir one, but it left the javadoc in an 
> inconsistent state (one would set destDir, but would get something 
> based on baseDir), so I didn't commit that one.

Yeah this one was a pain too.  I'm getting name hiding warnings from the 
compiler, the two options were to change each parameter in each method, 
or to change the member variable.  I decided on the latter as it needed 
only one change instead of many.

Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message