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]

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

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]

Gary Gregory
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: [hidden email] [mailto:[hidden email]]
Sent: Monday, June 27, 2005 1:24 PM
To: [hidden email]
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:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
lizationUtils.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
/org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
=202043&view=diff
========================================================================
======
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
lizationUtils.java (original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
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/java
/org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
iew=diff
========================================================================
======
---
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 = (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/enums
/Enum.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
/org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
view=diff
========================================================================
======
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
/Enum.java (original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
/Enum.java Mon Jun 27 13:24:10 2005
@@ -548,11 +548,11 @@
                 String name = (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/java
/org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
02043&view=diff
========================================================================
======
---
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: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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/Enum.java math/NumberUtils.java]

James Carman
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:[hidden email]]
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: [hidden email] [mailto:[hidden email]]
Sent: Monday, June 27, 2005 1:24 PM
To: [hidden email]
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:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
lizationUtils.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
/org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
=202043&view=diff
========================================================================
======
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
lizationUtils.java (original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
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/java
/org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
iew=diff
========================================================================
======
---
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 = (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/enums
/Enum.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
/org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
view=diff
========================================================================
======
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
/Enum.java (original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
/Enum.java Mon Jun 27 13:24:10 2005
@@ -548,11 +548,11 @@
                 String name = (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/java
/org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
02043&view=diff
========================================================================
======
---
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: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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/Enum.java math/NumberUtils.java]

Steven Caswell
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 <[hidden email]> 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:[hidden email]]
> 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: [hidden email] [mailto:[hidden email]]
> Sent: Monday, June 27, 2005 1:24 PM
> To: [hidden email]
> 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:
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> lizationUtils.java
> URL:
> http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> /org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> =202043&view=diff
> ========================================================================
> ======
> ---
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> lizationUtils.java (original)
> +++
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> 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/java
> /org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> iew=diff
> ========================================================================
> ======
> ---
> 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 = (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/enums
> /Enum.java
> URL:
> http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> /org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> view=diff
> ========================================================================
> ======
> ---
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> /Enum.java (original)
> +++
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> /Enum.java Mon Jun 27 13:24:10 2005
> @@ -548,11 +548,11 @@
>                  String name = (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/java
> /org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> 02043&view=diff
> ========================================================================
> ======
> ---
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[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

Steven Caswell
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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]]
> > 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: [hidden email] [mailto:[hidden email]]
> > Sent: Monday, June 27, 2005 1:24 PM
> > To: [hidden email]
> > 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:
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java
> > URL:
> > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > /org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> > =202043&view=diff
> > ========================================================================
> > ======
> > ---
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java (original)
> > +++
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > 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/java
> > /org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> > iew=diff
> > ========================================================================
> > ======
> > ---
> > 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 = (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/enums
> > /Enum.java
> > URL:
> > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > /org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> > view=diff
> > ========================================================================
> > ======
> > ---
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > /Enum.java (original)
> > +++
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > /Enum.java Mon Jun 27 13:24:10 2005
> > @@ -548,11 +548,11 @@
> >                  String name = (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/java
> > /org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> > 02043&view=diff
> > ========================================================================
> > ======
> > ---
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Steven Caswell
> [hidden email]
>
> Take back the web - http://www.mozilla.org
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[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/

Steven Caswell
In reply to this post by Steven Caswell
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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]]
> > 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: [hidden email] [mailto:[hidden email]]
> > Sent: Monday, June 27, 2005 1:24 PM
> > To: [hidden email]
> > 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:
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java
> > URL:
> > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > /org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> > =202043&view=diff
> > ========================================================================
> > ======
> > ---
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java (original)
> > +++
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > 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/java
> > /org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> > iew=diff
> > ========================================================================
> > ======
> > ---
> > 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 = (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/enums
> > /Enum.java
> > URL:
> > http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > /org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> > view=diff
> > ========================================================================
> > ======
> > ---
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > /Enum.java (original)
> > +++
> > jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > /Enum.java Mon Jun 27 13:24:10 2005
> > @@ -548,11 +548,11 @@
> >                  String name = (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/java
> > /org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> > 02043&view=diff
> > ========================================================================
> > ======
> > ---
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Steven Caswell
> [hidden email]
>
> Take back the web - http://www.mozilla.org
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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 enums/E

Gary Gregory
In reply to this post by Steven Caswell
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:[hidden email]]
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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]]
> > 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: [hidden email] [mailto:[hidden email]]
> > Sent: Monday, June 27, 2005 1:24 PM
> > To: [hidden email]
> > 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:
> >
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java
> > URL:
> >
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> >
/org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> > =202043&view=diff
> >
========================================================================
> > ======
> > ---
> >
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > lizationUtils.java (original)
> > +++
> >
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria

> > 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/java
> >
/org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> > iew=diff
> >
========================================================================
> > ======
> > ---
> >
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 = (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/enums
> > /Enum.java
> > URL:
> >
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> >
/org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> > view=diff
> >
========================================================================
> > ======
> > ---
> >
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > /Enum.java (original)
> > +++
> >
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums

> > /Enum.java Mon Jun 27 13:24:10 2005
> > @@ -548,11 +548,11 @@
> >                  String name = (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/java
> >
/org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> > 02043&view=diff
> >
========================================================================
> > ======
> > ---
> >
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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
---------------------------------------------------------------------

> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Steven Caswell
> [hidden email]
>
> Take back the web - http://www.mozilla.org
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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
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 <[hidden email]> 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:[hidden email]]
> 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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]]
> > > 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: [hidden email] [mailto:[hidden email]]
> > > Sent: Monday, June 27, 2005 1:24 PM
> > > To: [hidden email]
> > > 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:
> > >
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > > lizationUtils.java
> > > URL:
> > >
> http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > >
> /org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> > > =202043&view=diff
> > >
> ========================================================================
> > > ======
> > > ---
> > >
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > > lizationUtils.java (original)
> > > +++
> > >
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > > 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/java
> > >
> /org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> > > iew=diff
> > >
> ========================================================================
> > > ======
> > > ---
> > >
> 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 = (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/enums
> > > /Enum.java
> > > URL:
> > >
> http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > >
> /org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> > > view=diff
> > >
> ========================================================================
> > > ======
> > > ---
> > >
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > > /Enum.java (original)
> > > +++
> > >
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > > /Enum.java Mon Jun 27 13:24:10 2005
> > > @@ -548,11 +548,11 @@
> > >                  String name = (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/java
> > >
> /org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> > > 02043&view=diff
> > >
> ========================================================================
> > > ======
> > > ---
> > >
> 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: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> >
> > --
> > Steven Caswell
> > [hidden email]
> >
> > Take back the web - http://www.mozilla.org
> >
>
>
> --
> Steven Caswell
> [hidden email]
>
> Take back the web - http://www.mozilla.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Gary Gregory
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:[hidden email]]
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 <[hidden email]> 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:[hidden email]]
> 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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]]
> > > 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: [hidden email] [mailto:[hidden email]]
> > > Sent: Monday, June 27, 2005 1:24 PM
> > > To: [hidden email]
> > > 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:
> > >
>
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > > lizationUtils.java
> > > URL:
> > >
>
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > >
>
/org/apache/commons/lang/SerializationUtils.java?rev=202043&r1=202042&r2
> > > =202043&view=diff
> > >
>
========================================================================
> > > ======
> > > ---
> > >
>
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria
> > > lizationUtils.java (original)
> > > +++
> > >
>
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Seria

> > > 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/java
> > >
>
/org/apache/commons/lang/enum/Enum.java?rev=202043&r1=202042&r2=202043&v
> > > iew=diff
> > >
>
========================================================================
> > > ======
> > > ---
> > >
>
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 = (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/enums
> > > /Enum.java
> > > URL:
> > >
>
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java
> > >
>
/org/apache/commons/lang/enums/Enum.java?rev=202043&r1=202042&r2=202043&
> > > view=diff
> > >
>
========================================================================
> > > ======
> > > ---
> > >
>
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums
> > > /Enum.java (original)
> > > +++
> > >
>
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums

> > > /Enum.java Mon Jun 27 13:24:10 2005
> > > @@ -548,11 +548,11 @@
> > >                  String name = (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/java
> > >
>
/org/apache/commons/lang/math/NumberUtils.java?rev=202043&r1=202042&r2=2
> > > 02043&view=diff
> > >
>
========================================================================
> > > ======
> > > ---
> > >
>
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: [hidden email]
> > > For additional commands, e-mail:
[hidden email]
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail:
[hidden email]
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail:
[hidden email]

> > >
> > >
> >
> >
> > --
> > Steven Caswell
> > [hidden email]
> >
> > Take back the web - http://www.mozilla.org
> >
>
>
> --
> Steven Caswell
> [hidden email]
>
> Take back the web - http://www.mozilla.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Stephen Colebourne
In reply to this post by Steven Caswell
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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
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 <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Steven Caswell
[hidden email]

Take back the web - http://www.mozilla.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Gary Gregory
In reply to this post by Steven Caswell

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: [hidden email]
For additional commands, e-mail: [hidden email]