You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2002/11/07 22:39:28 UTC

[collection] PMD of Collections

Looking at the PMD report of Commons Collections, I've fixed the blatant
errors [see:
http://pmd.sourceforge.net/reports/jakartacommons_jakarta-commons.html]

It still leaves a lot in the Tests which are basically:

try {
   Object obj = someTest();
} catch(ExpectedException ee) {
   ...
}

It thinks these should be:

try {
    someTest();
} catch(...

So. Does anyone mind if I go through and remove all the variable naming?
Is it doing any real service [all it shows is return type, rtfjdoc]?

Hen


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collection] PMD of Collections

Posted by "Michael A. Smith" <ma...@apache.org>.
On Thu, 7 Nov 2002, Henri Yandell wrote:
> Looking at the PMD report of Commons Collections, I've fixed the blatant
> errors [see:
> http://pmd.sourceforge.net/reports/jakartacommons_jakarta-commons.html]
> 
> It still leaves a lot in the Tests which are basically:
> 
> try {
>    Object obj = someTest();
> } catch(ExpectedException ee) {
>    ...
> }
> 
> It thinks these should be:
> 
> try {
>     someTest();
> } catch(...
> 
> So. Does anyone mind if I go through and remove all the variable naming?
> Is it doing any real service [all it shows is return type, rtfjdoc]?

One benefit to this is that if the signature changes (i.e. the return
type), then the assignment won't compile.  In a way, reminding the
developer that changing the return type breaks things.  Without the
assignment, there is no typecheck.

But really, I don't think that's much of an argument because there
really should be some other test that's implicitly checking the return
type when it tests that the method returns an expected result.  So I'm
fine with removing the unused variables.

regards,
michael

-- 
Michael A. Smith
mas@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>