commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1440316 - in /commons/proper/cli/trunk/src: conf/checkstyle-suppressions.xml main/java/org/apache/commons/cli/OptionValidator.java main/java/org/apache/commons/cli/Util.java
Date Wed, 30 Jan 2013 09:27:31 GMT
Author: tn
Date: Wed Jan 30 09:27:30 2013
New Revision: 1440316

URL: http://svn.apache.org/viewvc?rev=1440316&view=rev
Log:
Prefer a checkstyle suppression over a private constructor for package private class, otherwise
the code coverage drops without a clean way to test the ctor.

Modified:
    commons/proper/cli/trunk/src/conf/checkstyle-suppressions.xml
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Util.java

Modified: commons/proper/cli/trunk/src/conf/checkstyle-suppressions.xml
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/conf/checkstyle-suppressions.xml?rev=1440316&r1=1440315&r2=1440316&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/conf/checkstyle-suppressions.xml (original)
+++ commons/proper/cli/trunk/src/conf/checkstyle-suppressions.xml Wed Jan 30 09:27:30 2013
@@ -30,4 +30,9 @@
   <!-- Constant used in hashCode() method                                       -->
   <suppress checks="MagicNumber" files="Option.java" />
 
+  <!-- These are final package private classes, and we do not want to hide the
+       constructor as this will negatively affect the code coverage             -->
+  <suppress checks="HideUtilityClassConstructor" files="OptionValidator.java" />
+  <suppress checks="HideUtilityClassConstructor" files="Util.java" />
+
 </suppressions>

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java?rev=1440316&r1=1440315&r2=1440316&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java Wed
Jan 30 09:27:30 2013
@@ -27,13 +27,6 @@ package org.apache.commons.cli;
 final class OptionValidator
 {
     /**
-     * Hide constructor for a utility class.
-     */
-    private OptionValidator()
-    {
-    }
-
-    /**
      * Validates whether <code>opt</code> is a permissible Option
      * shortOpt.  The rules that specify if the <code>opt</code>
      * is valid are:

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Util.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Util.java?rev=1440316&r1=1440315&r2=1440316&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Util.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Util.java Wed Jan 30 09:27:30
2013
@@ -26,13 +26,6 @@ package org.apache.commons.cli;
 final class Util
 {
     /**
-     * Hide constructor for a utility class.
-     */
-    private Util()
-    {
-    }
-
-    /**
      * Remove the hyphens from the beginning of <code>str</code> and
      * return the new String.
      *



Mime
View raw message