Author: ggregory Date: Fri Apr 15 20:17:33 2016 New Revision: 1739357 URL: http://svn.apache.org/viewvc?rev=1739357&view=rev Log: Add missing '@Override' annotations to implementations of interface methods.
Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/CreditCardValidator.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/ISBNCheckDigit.java commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/checkdigit/ModulusCheckDigit.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/CreditCardValidatorTest.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/CreditCardValidator.java?rev=1739357&r1=1739356&r2=1739357&view=diff ============================================================================== --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/CreditCardValidator.java Fri Apr 15 20:17:33 2016 @@ -222,6 +222,7 @@ public class CreditCardValidator { */ private static class Visa implements CreditCardType { private static final String PREFIX = "4"; + @Override public boolean matches(String card) { return ( card.substring(0, 1).equals(PREFIX) @@ -231,6 +232,7 @@ public class CreditCardValidator { private static class Amex implements CreditCardType { private static final String PREFIX = "34,37,"; + @Override public boolean matches(String card) { String prefix2 = card.substring(0, 2) + ","; return ((PREFIX.contains(prefix2)) && (card.length() == 15)); @@ -239,6 +241,7 @@ public class CreditCardValidator { private static class Discover implements CreditCardType { private static final String PREFIX = "6011"; + @Override public boolean matches(String card) { return (card.substring(0, 4).equals(PREFIX) && (card.length() == 16)); } @@ -246,6 +249,7 @@ public class CreditCardValidator { private static class Mastercard implements CreditCardType { private static final String PREFIX = "51,52,53,54,55,"; + @Override public boolean matches(String card) { String prefix2 = card.substring(0, 2) + ","; return ((PREFIX.contains(prefix2)) && (card.length() == 16)); 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=1739357&r1=1739356&r2=1739357&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 Fri Apr 15 20:17:33 2016 @@ -68,6 +68,7 @@ public final class IBANCheckDigit implem * @return <code>true</code> if the check digit is valid, otherwise * <code>false</code> */ + @Override public boolean isValid(String code) { if (code == null || code.length() < MIN_CODE_LEN) { return false; @@ -95,6 +96,7 @@ public final class IBANCheckDigit implem * @throws CheckDigitException if an error occurs calculating * the check digit for the specified code */ + @Override public String calculate(String code) throws CheckDigitException { if (code == null || code.length() < MIN_CODE_LEN) { throw new CheckDigitException("Invalid Code length=" + 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=1739357&r1=1739356&r2=1739357&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 Fri Apr 15 20:17:33 2016 @@ -63,6 +63,7 @@ public final class ISBNCheckDigit implem * length (i.e. not 9 or 12) or if there is an error calculating the * check digit. */ + @Override public String calculate(String code) throws CheckDigitException { if (code == null || code.length() == 0) { throw new CheckDigitException("ISBN Code is missing"); @@ -89,6 +90,7 @@ public final class ISBNCheckDigit implem * a valid ISBN-10 check digit or the code has a length of 13 and is * a valid ISBN-13 check digit - otherwise <code>false</code>. */ + @Override public boolean isValid(String code) { if (code == null) { return false; 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=1739357&r1=1739356&r2=1739357&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 Fri Apr 15 20:17:33 2016 @@ -66,6 +66,7 @@ public abstract class ModulusCheckDigit * @return <code>true</code> if the check digit is valid, otherwise * <code>false</code> */ + @Override public boolean isValid(String code) { if (code == null || code.length() == 0) { return false; @@ -86,6 +87,7 @@ public abstract class ModulusCheckDigit * @return The calculated Check Digit * @throws CheckDigitException if an error occurs calculating the check digit */ + @Override public String calculate(String code) throws CheckDigitException { if (code == null || code.length() == 0) { throw new CheckDigitException("Code is missing"); 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=1739357&r1=1739356&r2=1739357&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 Fri Apr 15 20:17:33 2016 @@ -74,6 +74,7 @@ public final class VerhoeffCheckDigit im * @return <code>true</code> if the check digit is valid, * otherwise <code>false</code> */ + @Override public boolean isValid(String code) { if (code == null || code.length() == 0) { return false; @@ -93,6 +94,7 @@ public final class VerhoeffCheckDigit im * @throws CheckDigitException if an error occurs calculating * the check digit for the specified code */ + @Override public String calculate(String code) throws CheckDigitException { if (code == null || code.length() == 0) { throw new CheckDigitException("Code is missing"); Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/CreditCardValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/CreditCardValidatorTest.java?rev=1739357&r1=1739356&r2=1739357&view=diff ============================================================================== --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/CreditCardValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/CreditCardValidatorTest.java Fri Apr 15 20:17:33 2016 @@ -78,6 +78,7 @@ public class CreditCardValidatorTest ext */ private class DinersClub implements CreditCardValidator.CreditCardType { private static final String PREFIX = "300,301,302,303,304,305,"; + @Override public boolean matches(String card) { String prefix = card.substring(0, 3) + ","; return ((PREFIX.contains(prefix)) && (card.length() == 14));