Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 94465 invoked from network); 29 Jun 2005 20:41:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2005 20:41:18 -0000 Received: (qmail 50145 invoked by uid 500); 29 Jun 2005 20:41:14 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 50073 invoked by uid 500); 29 Jun 2005 20:41:13 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 50060 invoked by uid 99); 29 Jun 2005 20:41:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2005 13:41:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of steven.caswell@gmail.com designates 64.233.170.201 as permitted sender) Received: from [64.233.170.201] (HELO rproxy.gmail.com) (64.233.170.201) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2005 13:41:16 -0700 Received: by rproxy.gmail.com with SMTP id r35so2115010rna for ; Wed, 29 Jun 2005 13:41:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hl9PC/z698rEFWyxWrhrGNh8q+xLLPbcnqtbm4sPl8rvGqOSVWIKOep7bJ6k1PE6P3RbQ4SxK0ykrOjkqN2BlMMwnlRCJgBhf5Wh/C+5gb6k2LNgqncGyGsOdm3Fqnq63ESphMARjv3uKAqAFTG4skGpppi4rCCoPARdBOhUdFA= Received: by 10.38.98.62 with SMTP id v62mr16915rnb; Wed, 29 Jun 2005 13:41:11 -0700 (PDT) Received: by 10.38.151.72 with HTTP; Wed, 29 Jun 2005 13:41:11 -0700 (PDT) Message-ID: Date: Wed, 29 Jun 2005 16:41:11 -0400 From: Steven Caswell Reply-To: Steven Caswell To: Jakarta Commons Developers List Subject: [lang] customizing the PMD report [WAS Re: added empty statement to empty catch blocks [WAS: svn commit: r202043 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: NumberUtils.java SerializationUtils.java enum/Enum.java enums/E In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200506272058.j5RKwurD008348@carmanconsulting.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N As I mentioned peviously, I added an empty statement to catch blocks because an empty catch block is not a good thing and an empty statement is a way to at least show there was a modicum of thought to having the catch do nothing. The empty statement works for some style checkers like Checkstyle but doesn't work with the default setting in PMD (it get reported as an empty statement outside a loop). I propose to add a custom ruleset to the PMD report generated by maven to include the catch block as an allowable place for an empty statement. On 6/27/05, Steven Caswell wrote: > Yep. In this case throwing a bone to the PMD checker.Of course if I > had actually rerun the PMD report before committing I would have > realized that it also doesn't like an empty statement outside of a > loop, so I really didn't fix anything PMD-wise. I'll have to rethink > that particular bone. >=20 > On 6/27/05, James Carman wrote: > > Some style checkers won't allow you to have empty code blocks. You mus= t at > > least have one empty statement. > > > > -----Original Message----- > > From: Gary Gregory [mailto:ggregory@seagullsoftware.com] > > Sent: Monday, June 27, 2005 4:54 PM > > To: Jakarta Commons Developers List > > Subject: added empty statement to empty catch blocks [WAS: svn commit: > > r202043 - in > > /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: > > NumberUtils.java SerializationUtils.java enum/Enum.java enums/Enum.java > > math/NumberUtils.java] > > > > Hello: > > > > What is the reason for this change? > > > > - //Too big for a long > > + ; //Too big for a long > > > > It looks very odd to me. > > > > Thanks, > > Gary > > > > -----Original Message----- > > From: stevencaswell@apache.org [mailto:stevencaswell@apache.org] > > Sent: Monday, June 27, 2005 1:24 PM > > To: commons-cvs@jakarta.apache.org > > Subject: svn commit: r202043 - in > > /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: > > NumberUtils.java SerializationUtils.java enum/Enum.java enums/Enum.java > > math/NumberUtils.java > > > > Author: stevencaswell > > Date: Mon Jun 27 13:24:10 2005 > > New Revision: 202043 > > > > URL: http://svn.apache.org/viewcvs?rev=3D202043&view=3Drev > > Log: > > added empty statement to empty catch blocks > > > > Modified: > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numb= e > > rUtils.java > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seri= a > > lizationUtils.java > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= / > > Enum.java > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= s > > /Enum.java > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math= / > > NumberUtils.java > > > > Modified: > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numb= e > > rUtils.java > > URL: > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/jav= a > > /org/apache/commons/lang/NumberUtils.java?rev=3D202043&r1=3D202042&r2= =3D202043 > > &view=3Ddiff > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D > > --- > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numb= e > > rUtils.java (original) > > +++ > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numb= e > > rUtils.java Mon Jun 27 13:24:10 2005 > > @@ -197,7 +197,7 @@ > > try { > > return createLong(numeric); > > } catch (NumberFormatException nfe) { > > - //Too big for a long > > + ; //Too big for a long > > } > > return createBigInteger(numeric); > > > > > > Modified: > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seri= a > > lizationUtils.java > > URL: > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/jav= a > > /org/apache/commons/lang/SerializationUtils.java?rev=3D202043&r1=3D2020= 42&r2 > > =3D202043&view=3Ddiff > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D > > --- > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seri= a > > lizationUtils.java (original) > > +++ > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seri= a > > lizationUtils.java Mon Jun 27 13:24:10 2005 > > @@ -114,7 +114,7 @@ > > out.close(); > > } > > } catch (IOException ex) { > > - // ignore; > > + ; // ignore > > } > > } > > } > > @@ -170,7 +170,7 @@ > > in.close(); > > } > > } catch (IOException ex) { > > - // ignore > > + ; // ignore > > } > > } > > } > > > > Modified: > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= / > > Enum.java > > URL: > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/jav= a > > /org/apache/commons/lang/enum/Enum.java?rev=3D202043&r1=3D202042&r2=3D2= 02043&v > > iew=3Ddiff > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D > > --- > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= / > > Enum.java (original) > > +++ > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= / > > Enum.java Mon Jun 27 13:24:10 2005 > > @@ -548,11 +548,11 @@ > > String name =3D (String) mth.invoke(other, null); > > return iName.equals(name); > > } catch (NoSuchMethodException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } catch (IllegalAccessException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } catch (InvocationTargetException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } > > return false; > > } > > > > Modified: > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= s > > /Enum.java > > URL: > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/jav= a > > /org/apache/commons/lang/enums/Enum.java?rev=3D202043&r1=3D202042&r2=3D= 202043& > > view=3Ddiff > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D > > --- > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= s > > /Enum.java (original) > > +++ > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum= s > > /Enum.java Mon Jun 27 13:24:10 2005 > > @@ -548,11 +548,11 @@ > > String name =3D (String) mth.invoke(other, null); > > return iName.equals(name); > > } catch (NoSuchMethodException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } catch (IllegalAccessException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } catch (InvocationTargetException e) { > > - // ignore - should never happen > > + ; // ignore - should never happen > > } > > return false; > > } > > > > Modified: > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math= / > > NumberUtils.java > > URL: > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/jav= a > > /org/apache/commons/lang/math/NumberUtils.java?rev=3D202043&r1=3D202042= &r2=3D2 > > 02043&view=3Ddiff > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =3D=3D=3D=3D=3D=3D > > --- > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math= / > > NumberUtils.java (original) > > +++ > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math= / > > NumberUtils.java Mon Jun 27 13:24:10 2005 > > @@ -456,7 +456,7 @@ > > try { > > return createLong(numeric); > > } catch (NumberFormatException nfe) { > > - //Too big for a long > > + ; //Too big for a long > > } > > return createBigInteger(numeric); > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > >=20 >=20 > -- > Steven Caswell > steven.caswell@gmail.com >=20 > Take back the web - http://www.mozilla.org >=20 --=20 Steven Caswell steven.caswell@gmail.com Take back the web - http://www.mozilla.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org