RE: [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 enu
Steven Caswell wrote: " > Actually, I was proposing to leave the ; in to mark the empty > statement (sorry I wasn't clear). I'd prefer not to have the ; if possible. It just looks and feels very odd, esp. when a comment would do logically. Stephen " +1 from me. Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [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 enu
My reasoning behind using a semicolon is that this is the defined statement in the Language Specification for denoting an empty statement, and something that code checkers/syntax parsers/etc can easily be told to look for. One syntax, no ambiguity. As opposed to comments which are not the language-specified way to indicate an empty statement, are ambiguous, and make it difficult for checkers to discover. On 6/29/05, Stephen Colebourne <[EMAIL PROTECTED]> wrote: > Steven Caswell wrote: > > Actually, I was proposing to leave the ; in to mark the empty > > statement (sorry I wasn't clear). > > I'd prefer not to have the ; if possible. It just looks and feels very > odd, esp. when a comment would do logically. > > Stephen > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Steven Caswell [EMAIL PROTECTED] Take back the web - http://www.mozilla.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [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 enu
Steven Caswell wrote: Actually, I was proposing to leave the ; in to mark the empty statement (sorry I wasn't clear). I'd prefer not to have the ; if possible. It just looks and feels very odd, esp. when a comment would do logically. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [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 enu
Ah, miscommunication then. My feeling is that we should not tweak our code due to a shortcoming in either a tool or our [mis]configuration of a tool. 2c, Gary -Original Message- From: Steven Caswell [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 2:13 PM To: Jakarta Commons Developers List Subject: Re: [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 enu Actually, I was proposing to leave the ; in to mark the empty statement (sorry I wasn't clear).This is the simplest way to make PMD know about the empty statement. On 6/29/05, Gary Gregory <[EMAIL PROTECTED]> wrote: > I am +1 on removing the ";" and making the style checker behave with > reason. > > IMHO, an empty catch block is OK IFF it is { // documented in-line }. I > have my Eclipse settings set to warn me of this but I know not everyone > uses Eclipse. > > Gary > > -Original Message- > From: Steven Caswell [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 29, 2005 1:41 PM > 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 > > 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 <[EMAIL PROTECTED]> 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. > > > > On 6/27/05, James Carman <[EMAIL PROTECTED]> wrote: > > > Some style checkers won't allow you to have empty code blocks. You > must at > > > least have one empty statement. > > > > > > -Original Message- > > > From: Gary Gregory [mailto:[EMAIL PROTECTED] > > > 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Sent: Monday, June 27, 2005 1:24 PM > > > To: [EMAIL PROTECTED] > > > 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=202043&view=rev > > > Log: > > > added empty statement to empty catch blocks > > > > > > Modified: > > > > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numbe > > > rUtils.java > > > > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria > > > lizationUtils.java > > > > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/ > > > Enum.java > > > > > > > jakarta/commons/proper/la
Re: [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 enu
Actually, I was proposing to leave the ; in to mark the empty statement (sorry I wasn't clear).This is the simplest way to make PMD know about the empty statement. On 6/29/05, Gary Gregory <[EMAIL PROTECTED]> wrote: > I am +1 on removing the ";" and making the style checker behave with > reason. > > IMHO, an empty catch block is OK IFF it is { // documented in-line }. I > have my Eclipse settings set to warn me of this but I know not everyone > uses Eclipse. > > Gary > > -Original Message- > From: Steven Caswell [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 29, 2005 1:41 PM > 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 > > 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 <[EMAIL PROTECTED]> 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. > > > > On 6/27/05, James Carman <[EMAIL PROTECTED]> wrote: > > > Some style checkers won't allow you to have empty code blocks. You > must at > > > least have one empty statement. > > > > > > -Original Message- > > > From: Gary Gregory [mailto:[EMAIL PROTECTED] > > > 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Sent: Monday, June 27, 2005 1:24 PM > > > To: [EMAIL PROTECTED] > > > 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=202043&view=rev > > > Log: > > > added empty statement to empty catch blocks > > > > > > Modified: > > > > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numbe > > > rUtils.java > > > > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria > > > 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/enums > > > /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/Numbe > > > rUtils.java > > > URL: > > > > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java > > > > /org/apache/commons/lang/NumberUtils.java?rev=202043&r1=202042&r2=202043 > > > &view=diff > > > > > > > == > > > --- > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numbe > > > rUtils.java (original) > > > +++ > > > > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Numbe > > > 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: > > >