dgraham 2004/01/31 18:41:25 Modified: validator/src/share/org/apache/commons/validator CreditCardValidator.java UrlValidator.java Log: Use left shift operator for constants to make numbering easier. Revision Changes Path 1.15 +7 -7 jakarta-commons/validator/src/share/org/apache/commons/validator/CreditCardValidator.java Index: CreditCardValidator.java =================================================================== RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/CreditCardValidator.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- CreditCardValidator.java 17 Jan 2004 19:22:02 -0000 1.14 +++ CreditCardValidator.java 1 Feb 2004 02:41:25 -0000 1.15 @@ -104,22 +104,22 @@ /** * Option specifying that American Express cards are allowed. */ - public static final int AMEX = 1; + public static final int AMEX = 1 << 0; /** * Option specifying that Visa cards are allowed. */ - public static final int VISA = 2; + public static final int VISA = 1 << 1; /** * Option specifying that Mastercard cards are allowed. */ - public static final int MASTERCARD = 4; + public static final int MASTERCARD = 1 << 2; /** * Option specifying that Discover cards are allowed. */ - public static final int DISCOVER = 8; + public static final int DISCOVER = 1 << 3; /** * The CreditCardTypes that are allowed to pass validation. 1.18 +6 -6 jakarta-commons/validator/src/share/org/apache/commons/validator/UrlValidator.java Index: UrlValidator.java =================================================================== RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/UrlValidator.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- UrlValidator.java 11 Jan 2004 23:30:20 -0000 1.17 +++ UrlValidator.java 1 Feb 2004 02:41:25 -0000 1.18 @@ -120,17 +120,17 @@ * Allows all validly formatted schemes to pass validation instead of supplying a * set of valid schemes. */ - public static final int ALLOW_ALL_SCHEMES = 1; + public static final int ALLOW_ALL_SCHEMES = 1 << 0; /** * Allow two slashes in the path component of the URL. */ - public static final int ALLOW_2_SLASHES = 2; + public static final int ALLOW_2_SLASHES = 1 << 1; /** * Enabling this options disallows any URL fragments. */ - public static final int NO_FRAGMENTS = 4; + public static final int NO_FRAGMENTS = 1 << 2; private static final String ALPHA_CHARS = "a-zA-Z";
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]