Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 8779 invoked from network); 7 Nov 2002 22:24:52 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Nov 2002 22:24:52 -0000 Received: (qmail 23339 invoked by uid 97); 7 Nov 2002 22:25:51 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 23280 invoked by uid 97); 7 Nov 2002 22:25:49 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 23261 invoked by uid 98); 7 Nov 2002 22:25:48 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) X-Server-Uuid: 6E802067-ECFC-4FC2-A617-DD5220DD9CBB Message-ID: <7382FCA44E27D411BD4A00508BD68F95053CD550@pigeon.tumbleweed.com> From: "Martin Cooper" To: "'Jakarta Commons Developers List'" Subject: RE: [collection] PMD of Collections Date: Thu, 7 Nov 2002 14:21:54 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) X-WSS-ID: 11D43774742458-01-01 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Michael A. Smith [mailto:mas@apache.org] > Sent: Thursday, November 07, 2002 1:49 PM > To: Jakarta Commons Developers List > Subject: Re: [collection] PMD of Collections > > > 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-comm > ons.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. If the code is really like the example above, and the assignment is to an Object, then compilation will only break if the return type is changed to a primitive or void. ;-) -- Martin Cooper > > 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: > > For additional commands, e-mail: > > > -- To unsubscribe, e-mail: For additional commands, e-mail: