commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r909009 - in /commons/proper/validator/trunk/src: main/java/org/apache/commons/validator/routines/ main/java/org/apache/commons/validator/routines/checkdigit/ test/java/org/apache/commons/validator/routines/ test/java/org/apache/commons/val...
Date Thu, 11 Feb 2010 14:59:54 GMT
Author: niallp
Date: Thu Feb 11 14:59:45 2010
New Revision: 909009

URL: http://svn.apache.org/viewvc?rev=909009&view=rev
Log:
Rename static checkDigit instances from "INSTANCE" to something more meaningful (with an eye
on static imports)

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CodeValidatorTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigitTest.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
Thu Feb 11 14:59:45 2010
@@ -89,7 +89,7 @@
     /**
      * Luhn checkdigit validator for the card numbers.
      */
-    private static final CheckDigit LUHN_VALIDATOR = LuhnCheckDigit.INSTANCE;
+    private static final CheckDigit LUHN_VALIDATOR = LuhnCheckDigit.LUHN_CHECK_DIGIT;
 
     /** American Express (Amex) Card Validator */
     public static final CodeValidator AMEX_VALIDATOR = new CodeValidator("^(3[47]\\d{13})$",
LUHN_VALIDATOR);

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/ISBNValidator.java
Thu Feb 11 14:59:45 2010
@@ -84,10 +84,10 @@
 
 
     /** ISBN-10 Code Validator */
-    private CodeValidator isbn10Validator = new CodeValidator(ISBN10_REGEX, 10, ISBN10CheckDigit.INSTANCE);
+    private CodeValidator isbn10Validator = new CodeValidator(ISBN10_REGEX, 10, ISBN10CheckDigit.ISBN10_CHECK_DIGIT);
 
     /** ISBN-13 Code Validator */
-    private CodeValidator isbn13Validator = new CodeValidator(ISBN13_REGEX, 13, EAN13CheckDigit.INSTANCE);
+    private CodeValidator isbn13Validator = new CodeValidator(ISBN13_REGEX, 13, EAN13CheckDigit.EAN13_CHECK_DIGIT);
 
     private final boolean convert;
 

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -42,7 +42,7 @@
 public final class ABANumberCheckDigit extends ModulusCheckDigit {
 
     /** Singleton Routing Transit Number Check Digit instance */
-    public static final CheckDigit INSTANCE = new ABANumberCheckDigit();
+    public static final CheckDigit ABAN_CHECK_DIGIT = new ABANumberCheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {3, 1, 7};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -39,7 +39,7 @@
 public final class CUSIPCheckDigit extends ModulusCheckDigit {
 
     /** Singleton CUSIP Check Digit instance */
-    public static final CheckDigit INSTANCE = new CUSIPCheckDigit();
+    public static final CheckDigit CUSIP_CHECK_DIGIT = new CUSIPCheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {2, 1};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -43,7 +43,7 @@
 public final class EAN13CheckDigit extends ModulusCheckDigit {
 
     /** Singleton EAN-13 Check Digit instance */
-    public static final CheckDigit INSTANCE = new EAN13CheckDigit();
+    public static final CheckDigit EAN13_CHECK_DIGIT = new EAN13CheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {3, 1};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -41,7 +41,7 @@
 public final class IBANCheckDigit implements CheckDigit, Serializable {
 
     /** Singleton IBAN Number Check Digit instance */
-    public static final CheckDigit INSTANCE = new IBANCheckDigit();
+    public static final CheckDigit IBAN_CHECK_DIGIT = new IBANCheckDigit();
 
     private static final long MAX = 999999999; 
 

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -45,7 +45,7 @@
 public final class ISBN10CheckDigit extends ModulusCheckDigit {
 
     /** Singleton ISBN-10 Check Digit instance */
-    public static final CheckDigit INSTANCE = new ISBN10CheckDigit();
+    public static final CheckDigit ISBN10_CHECK_DIGIT = new ISBN10CheckDigit();
 
     /**
      * Construct a modulus 11 Check Digit routine for ISBN-10.

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -23,8 +23,8 @@
  * <p>
  * This implementation validates/calculates ISBN check digits
  * based on the length of the code passed to it - delegating
- * either to the {@link ISBNCheckDigit#ISBN10} or the
- * {@link ISBNCheckDigit#ISBN13} routines to perform the actual
+ * either to the {@link ISBNCheckDigit#ISBN10_CHECK_DIGIT} or the
+ * {@link ISBNCheckDigit#ISBN13_CHECK_DIGIT} routines to perform the actual
  * validation/calculation.
  * <p>
  * <b>N.B.</b> From 1st January 2007 the book industry will start to use a new
13 digit
@@ -37,13 +37,13 @@
 public final class ISBNCheckDigit implements CheckDigit, Serializable {
 
     /** Singleton ISBN-10 Check Digit instance */
-    public static final CheckDigit ISBN10 = ISBN10CheckDigit.INSTANCE;
+    public static final CheckDigit ISBN10_CHECK_DIGIT = ISBN10CheckDigit.ISBN10_CHECK_DIGIT;
 
     /** Singleton ISBN-13 Check Digit instance */
-    public static final CheckDigit ISBN13 = EAN13CheckDigit.INSTANCE;
+    public static final CheckDigit ISBN13_CHECK_DIGIT = EAN13CheckDigit.EAN13_CHECK_DIGIT;
 
     /** Singleton combined ISBN-10 / ISBN-13 Check Digit instance */
-    public static final CheckDigit ISBN   = new ISBNCheckDigit();
+    public static final CheckDigit ISBN_CHECK_DIGIT   = new ISBNCheckDigit();
 
     /**
      * Calculate an ISBN-10 or ISBN-13 check digit, depending
@@ -65,9 +65,9 @@
         if (code == null || code.length() == 0) {
             throw new CheckDigitException("ISBN Code is missing");
         } else if (code.length() == 9) {
-            return ISBN10.calculate(code);
+            return ISBN10_CHECK_DIGIT.calculate(code);
         } else if (code.length() == 12) {
-            return ISBN13.calculate(code);
+            return ISBN13_CHECK_DIGIT.calculate(code);
         } else {
             throw new CheckDigitException("Invalid ISBN Length = " + code.length());
         }
@@ -91,9 +91,9 @@
         if (code == null) {
             return false;
         } else if (code.length() == 10) {
-            return ISBN10.isValid(code);
+            return ISBN10_CHECK_DIGIT.isValid(code);
         } else if (code.length() == 13) {
-            return ISBN13.isValid(code);
+            return ISBN13_CHECK_DIGIT.isValid(code);
         } else {
             return false;
         }

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -37,7 +37,7 @@
 public final class ISINCheckDigit extends ModulusCheckDigit {
 
     /** Singleton ISIN Check Digit instance */
-    public static final CheckDigit INSTANCE = new ISINCheckDigit();
+    public static final CheckDigit ISIN_CHECK_DIGIT = new ISINCheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {2, 1};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
 public final class LuhnCheckDigit extends ModulusCheckDigit {
 
     /** Singleton Luhn Check Digit instance */
-    public static final CheckDigit INSTANCE = new LuhnCheckDigit();
+    public static final CheckDigit LUHN_CHECK_DIGIT = new LuhnCheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {2, 1};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -39,7 +39,7 @@
 public final class SedolCheckDigit extends ModulusCheckDigit {
 
     /** Singleton ISBN-10 check digit instance */
-    public static final CheckDigit INSTANCE = new SedolCheckDigit();
+    public static final CheckDigit SEDOL_CHECK_DIGIT = new SedolCheckDigit();
 
     /** weighting given to digits depending on their right position */
     private static final int[] POSITION_WEIGHT = new int[] {1, 3, 1, 7, 3, 9, 1};

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigit.java
Thu Feb 11 14:59:45 2010
@@ -34,7 +34,7 @@
 public final class VerhoeffCheckDigit implements CheckDigit, Serializable {
 
     /** Singleton Verhoeff Check Digit instance */
-    public static final CheckDigit INSTANCE = new VerhoeffCheckDigit();
+    public static final CheckDigit VERHOEFF_CHECK_DIGIT = new VerhoeffCheckDigit();
 
     /** D - multiplication table */
     private static final int[][] D_TABLE = new int[][] {

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CodeValidatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CodeValidatorTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CodeValidatorTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CodeValidatorTest.java
Thu Feb 11 14:59:45 2010
@@ -67,7 +67,7 @@
         assertEquals("No CheckDigit (is) valid",    true, validator.isValid(validEAN));
 
         // Use the EAN-13 check digit routine
-        validator = new CodeValidator((String)null, -1, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator((String)null, -1, EAN13CheckDigit.EAN13_CHECK_DIGIT);
 
         assertNotNull("EAN CheckDigit", validator.getCheckDigit());
         assertEquals("EAN CheckDigit invalid",       null, validator.validate(invalidEAN));
@@ -203,46 +203,46 @@
         RegexValidator regex = new RegexValidator("^[0-9]*$");
 
         // Constructor 1
-        validator = new CodeValidator(regex, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator(regex, EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 1 - regex",      regex, validator.getRegexValidator());
         assertEquals("Constructor 1 - min length", -1, validator.getMinLength());
         assertEquals("Constructor 1 - max length", -1, validator.getMaxLength());
-        assertEquals("Constructor 1 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 1 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
 
         // Constructor 2
-        validator = new CodeValidator(regex, 13, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator(regex, 13, EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 2 - regex",      regex, validator.getRegexValidator());
         assertEquals("Constructor 2 - min length", 13, validator.getMinLength());
         assertEquals("Constructor 2 - max length", 13, validator.getMaxLength());
-        assertEquals("Constructor 2 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 2 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
 
         // Constructor 3
-        validator = new CodeValidator(regex, 10, 20, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator(regex, 10, 20, EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 3 - regex",      regex, validator.getRegexValidator());
         assertEquals("Constructor 3 - min length", 10, validator.getMinLength());
         assertEquals("Constructor 3 - max length", 20, validator.getMaxLength());
-        assertEquals("Constructor 3 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 3 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
 
         // Constructor 4
-        validator = new CodeValidator("^[0-9]*$", EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator("^[0-9]*$", EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 4 - regex",      "RegexValidator{^[0-9]*$}", validator.getRegexValidator().toString());
         assertEquals("Constructor 4 - min length", -1, validator.getMinLength());
         assertEquals("Constructor 4 - max length", -1, validator.getMaxLength());
-        assertEquals("Constructor 4 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 4 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
 
         // Constructor 5
-        validator = new CodeValidator("^[0-9]*$", 13, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator("^[0-9]*$", 13, EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 5 - regex",      "RegexValidator{^[0-9]*$}", validator.getRegexValidator().toString());
         assertEquals("Constructor 5 - min length", 13, validator.getMinLength());
         assertEquals("Constructor 5 - max length", 13, validator.getMaxLength());
-        assertEquals("Constructor 5 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 5 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
 
         // Constructor 6
-        validator = new CodeValidator("^[0-9]*$", 10, 20, EAN13CheckDigit.INSTANCE);
+        validator = new CodeValidator("^[0-9]*$", 10, 20, EAN13CheckDigit.EAN13_CHECK_DIGIT);
         assertEquals("Constructor 6 - regex",      "RegexValidator{^[0-9]*$}", validator.getRegexValidator().toString());
         assertEquals("Constructor 6 - min length", 10, validator.getMinLength());
         assertEquals("Constructor 6 - max length", 20, validator.getMaxLength());
-        assertEquals("Constructor 6 - check digit", EAN13CheckDigit.INSTANCE, validator.getCheckDigit());
+        assertEquals("Constructor 6 - check digit", EAN13CheckDigit.EAN13_CHECK_DIGIT, validator.getCheckDigit());
     }
 
 }

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java
Thu Feb 11 14:59:45 2010
@@ -460,7 +460,7 @@
     public void testMastercardUsingSeparators() {
 
         String MASTERCARD_REGEX_SEP = "^(5[1-5]\\d{2})(?:[- ])?(\\d{4})(?:[- ])?(\\d{4})(?:[-
])?(\\d{4})$";
-        CodeValidator validator = new CodeValidator(MASTERCARD_REGEX_SEP, LuhnCheckDigit.INSTANCE);
+        CodeValidator validator = new CodeValidator(MASTERCARD_REGEX_SEP, LuhnCheckDigit.LUHN_CHECK_DIGIT);
         RegexValidator regex    = validator.getRegexValidator();
 
         // ****** Test Regular Expression ******

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ABANumberCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = ABANumberCheckDigit.INSTANCE;
+        routine = ABANumberCheckDigit.ABAN_CHECK_DIGIT;
         valid = new String[] {
                 "123456780",
                 "123123123",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = CUSIPCheckDigit.INSTANCE;
+        routine = CUSIPCheckDigit.CUSIP_CHECK_DIGIT;
         valid = new String[] {"037833100",
                               "931142103",
                               "837649128",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/EAN13CheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = EAN13CheckDigit.INSTANCE;
+        routine = EAN13CheckDigit.EAN13_CHECK_DIGIT;
         valid = new String[] {
                 "9780072129519",
                 "9780764558313",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/IBANCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -42,7 +42,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = IBANCheckDigit.INSTANCE;
+        routine = IBANCheckDigit.IBAN_CHECK_DIGIT;
         valid  = new String[]  {
                 "AD1200012030200359100100",
                 "AT611904300234573201",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBN10CheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = ISBN10CheckDigit.INSTANCE;
+        routine = ISBN10CheckDigit.ISBN10_CHECK_DIGIT;
         valid = new String[] {
                 "1930110995",
                 "020163385X",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = ISBNCheckDigit.ISBN;
+        routine = ISBNCheckDigit.ISBN_CHECK_DIGIT;
         valid = new String[] {
                 "9780072129519",
                 "9780764558313",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = ISINCheckDigit.INSTANCE;
+        routine = ISINCheckDigit.ISIN_CHECK_DIGIT;
         valid = new String[] {"US0378331005",
                               "BMG8571G1096",
                               "AU0000XVGZA3",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/LuhnCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -46,7 +46,7 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        routine = LuhnCheckDigit.INSTANCE;
+        routine = LuhnCheckDigit.LUHN_CHECK_DIGIT;
 
         valid = new String[] {
                 VALID_VISA,

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -38,7 +38,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = SedolCheckDigit.INSTANCE;
+        routine = SedolCheckDigit.SEDOL_CHECK_DIGIT;
         valid = new String[] {
                 "0263494",
                 "0870612",

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigitTest.java?rev=909009&r1=909008&r2=909009&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigitTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/checkdigit/VerhoeffCheckDigitTest.java
Thu Feb 11 14:59:45 2010
@@ -37,7 +37,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();
-        routine = VerhoeffCheckDigit.INSTANCE;
+        routine = VerhoeffCheckDigit.VERHOEFF_CHECK_DIGIT;
         valid = new String[] {
                 "15",
                 "1428570",



Mime
View raw message