commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1648367 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
Date Mon, 29 Dec 2014 15:26:29 GMT
Author: ggregory
Date: Mon Dec 29 15:26:28 2014
New Revision: 1648367

URL: http://svn.apache.org/r1648367
Log:
Statement unnecessarily nested within else clause.

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java?rev=1648367&r1=1648366&r2=1648367&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.java
Mon Dec 29 15:26:28 2014
@@ -157,10 +157,9 @@ public abstract class ModulusCheckDigit
             throws CheckDigitException {
         if (Character.isDigit(character)) {
             return Character.getNumericValue(character);
-        } else {
-            throw new CheckDigitException("Invalid Character[" +
-                    leftPos + "] = '" + character + "'");
         }
+        throw new CheckDigitException("Invalid Character[" +
+                leftPos + "] = '" + character + "'");
     }
 
     /**
@@ -179,10 +178,9 @@ public abstract class ModulusCheckDigit
             throws CheckDigitException {
         if (charValue >= 0 && charValue <= 9) {
             return Integer.toString(charValue);
-        } else {
-            throw new CheckDigitException("Invalid Check Digit Value =" +
-                    + charValue);
         }
+        throw new CheckDigitException("Invalid Check Digit Value =" +
+                + charValue);
     }
 
     /**



Mime
View raw message