cvs commit: jakarta-commons/validator/src/test/org/apache/commons/validator/util FlagsTest.java
rleland 2004/02/21 09:10:30 Modified:validator LICENSE.txt validator/etc jsdoc.sh validator/src/example/org/apache/commons/validator/example ValidateBean.java ValidateExample.java validator/src/share/org/apache/commons/validator Arg.java Constant.java CreditCardValidator.java DateValidator.java EmailValidator.java Field.java Form.java FormSet.java GenericTypeValidator.java GenericValidator.java Msg.java UrlValidator.java Validator.java ValidatorAction.java ValidatorException.java ValidatorResources.java ValidatorResourcesInitializer.java ValidatorResult.java ValidatorResults.java ValidatorUtil.java Var.java validator/src/share/org/apache/commons/validator/util Flags.java ValidatorUtils.java validator/src/test/org/apache/commons/validator ByteTest.java CreditCardValidatorTest.java DoubleTest.java EmailTest.java ExceptionTest.java FieldTest.java FloatTest.java IntegerTest.java LocaleTest.java LongTest.java MultipleConfigFilesTest.java MultipleTests.java NameBean.java RequiredIfTest.java RequiredNameTest.java ShortTest.java TestCommon.java TestNumber.java TestPair.java TestTypeValidator.java TestValidator.java TypeBean.java TypeTest.java UrlTest.java ValidatorTest.java ValidatorTestSuite.java ValueBean.java validator/src/test/org/apache/commons/validator/util FlagsTest.java Log: Update to Apache License. 2.0 The ptyhon script worked 100 % on jav a code and only removed the #!/bin/sh on shell code, very nice ! Revision ChangesPath 1.4 +15 -55jakarta-commons/validator/LICENSE.txt http://cvs.apache.org/viewcvs/jakarta-commons/validator/LICENSE.txt.diff?r1=1.3r2=1.4 1.3 +19 -1 jakarta-commons/validator/etc/jsdoc.sh http://cvs.apache.org/viewcvs/jakarta-commons/validator/etc/jsdoc.sh.diff?r1=1.2r2=1.3 1.4 +15 -55 jakarta-commons/validator/src/example/org/apache/commons/validator/example/ValidateBean.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/example/org/apache/commons/validator/example/ValidateBean.java.diff?r1=1.3r2=1.4 1.17 +15 -55 jakarta-commons/validator/src/example/org/apache/commons/validator/example/ValidateExample.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/example/org/apache/commons/validator/example/ValidateExample.java.diff?r1=1.16r2=1.17 1.17 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/Arg.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Arg.java.diff?r1=1.16r2=1.17 1.10 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/Constant.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Constant.java.diff?r1=1.9r2=1.10 1.16 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/CreditCardValidator.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/CreditCardValidator.java.diff?r1=1.15r2=1.16 1.6 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/DateValidator.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/DateValidator.java.diff?r1=1.5r2=1.6 1.12 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/EmailValidator.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/EmailValidator.java.diff?r1=1.11r2=1.12 1.31 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/Field.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Field.java.diff?r1=1.30r2=1.31 1.14 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/Form.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Form.java.diff?r1=1.13r2=1.14 1.15 +15 -55 jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/FormSet.java.diff?r1=1.14r2=1.15 1.13 +15 -55
cvs commit: jakarta-commons/validator/src/test/org/apache/commons/validator/util FlagsTest.java
dgraham 2004/01/17 09:32:28 Modified:validator/src/share/org/apache/commons/validator/util Flags.java validator/src/test/org/apache/commons/validator/util FlagsTest.java Log: Added Flags.clear() method and test, javadoc changes, throw RuntimeException if clone fails instead of InternalError. Revision ChangesPath 1.6 +25 -20 jakarta-commons/validator/src/share/org/apache/commons/validator/util/Flags.java Index: Flags.java === RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/util/Flags.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Flags.java11 Jan 2004 23:30:21 - 1.5 +++ Flags.java17 Jan 2004 17:32:28 - 1.6 @@ -7,7 +7,7 @@ * * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2004 The Apache Software Foundation. All rights + * Copyright (c) 2003-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,19 +64,15 @@ import java.io.Serializable; /** - * Represents a collection of 64 boolean (on/off) flags. Individual flags are - * represented by powers of 2. For example,br/ + * Represents a collection of 64 boolean (on/off) flags. Individual flags + * are represented by powers of 2. For example,br/ * Flag 1 = 1br/ * Flag 2 = 2br/ * Flag 3 = 4br/ * Flag 4 = 8br/ * p - * There cannot be a flag with a value of 3 because that represents Flag 1 and Flag - * 2 both being on/true. - * /p - * p - * Typically this class will be used in support of another class with constants - * and not directly by clients. + * There cannot be a flag with a value of 3 because that represents Flag 1 + * and Flag 2 both being on/true. * /p */ public class Flags implements Serializable { @@ -109,16 +105,16 @@ } /** - * Tests whether the given flag is on. If the flag is not a power of 2 (ie. 3) this - * tests whether the combination of flags is on. + * Tests whether the given flag is on. If the flag is not a power of 2 + * (ie. 3) this tests whether the combination of flags is on. */ public boolean isOn(long flag) { return (this.flags flag) 0; } /** - * Tests whether the given flag is off. If the flag is not a power of 2 (ie. 3) this - * tests whether the combination of flags is off. + * Tests whether the given flag is off. If the flag is not a power of 2 + * (ie. 3) this tests whether the combination of flags is off. */ public boolean isOff(long flag) { return (this.flags flag) == 0; @@ -146,9 +142,17 @@ public void turnOffAll() { this.flags = 0; } + +/** + * Turn off all flags. This is a synonym for codeturnOffAll()/code. + * @since Validator 1.1.1 + */ +public void clear() { +this.flags = 0; +} /** - * Turn on all 32 flags. + * Turn on all 64 flags. */ public void turnOnAll() { this.flags = Long.MAX_VALUE; @@ -162,7 +166,7 @@ try { return super.clone(); } catch(CloneNotSupportedException e) { -throw new InternalError(Couldn't clone Flags object.); +throw new RuntimeException(Couldn't clone Flags object.); } } @@ -194,8 +198,9 @@ } /** - * Returns a 64 length String with the first flag on the right and the 64th flag on - * the left. A 1 indicates the flag is on, a 0 means it's off. + * Returns a 64 length String with the first flag on the right and the + * 64th flag on the left. A 1 indicates the flag is on, a 0 means it's + * off. */ public String toString() { StringBuffer bin = new StringBuffer(Long.toBinaryString(this.flags)); 1.4 +11 -6 jakarta-commons/validator/src/test/org/apache/commons/validator/util/FlagsTest.java Index: FlagsTest.java === RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/util/FlagsTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FlagsTest.java11 Jan 2004 23:30:22 - 1.3 +++ FlagsTest.java17 Jan 2004 17:32:28 - 1.4 @@ -77,10 +77,9 @@ /** * Constructor for FlagsTest. - * @param arg0 */ - public FlagsTest(String arg0) { - super(arg0); + public FlagsTest(String name) { + super(name); } public void
cvs commit: jakarta-commons/validator/src/test/org/apache/commons/validator/util FlagsTest.java
dgraham 2003/10/05 09:47:28 Modified:validator/src/test/org/apache/commons/validator ValidatorTest.java DoubleTest.java ValidatorTestSuite.java LongTest.java ValueBean.java MultipleConfigFilesTest.java validator/src/example/org/apache/commons/validator/example ValidateExample.java ValidateBean.java validator/src/test/org/apache/commons/validator/util FlagsTest.java Log: Fixed Apache license. Revision ChangesPath 1.15 +9 -11 jakarta-commons/validator/src/test/org/apache/commons/validator/ValidatorTest.java Index: ValidatorTest.java === RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/ValidatorTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ValidatorTest.java8 Jun 2003 07:11:24 - 1.14 +++ ValidatorTest.java5 Oct 2003 16:47:27 - 1.15 @@ -23,20 +23,20 @@ *distribution. * * 3. The end-user documentation included with the redistribution, if - *any, must include the following acknowlegement: + *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * - * 4. The names The Jakarta Project, Commons, and Apache Software + * 4. The names, Apache, The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache - *nor may Apache appear in their names without prior written - *permission of the Apache Group. + *nor may Apache appear in their name, without prior written + *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -59,7 +59,6 @@ * */ - package org.apache.commons.validator; import java.text.DateFormat; @@ -74,14 +73,13 @@ import junit.framework.TestSuite; import org.apache.commons.validator.util.ValidatorUtils; - /** * pPerforms Validation Test./p * * @author David Winterfeldt * @version $Revision$ $Date$ -*/ + */ public class ValidatorTest extends TestCase { public ValidatorTest(String name) { 1.14 +4 -6 jakarta-commons/validator/src/test/org/apache/commons/validator/DoubleTest.java Index: DoubleTest.java === RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/DoubleTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- DoubleTest.java 5 Oct 2003 16:41:09 - 1.13 +++ DoubleTest.java 5 Oct 2003 16:47:27 - 1.14 @@ -59,12 +59,10 @@ * */ - package org.apache.commons.validator; import junit.framework.Test; import junit.framework.TestSuite; - /** * pPerforms Validation Test for codedouble/code validations./p 1.12 +8 -8 jakarta-commons/validator/src/test/org/apache/commons/validator/ValidatorTestSuite.java Index: ValidatorTestSuite.java === RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/ValidatorTestSuite.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ValidatorTestSuite.java 28 Sep 2003 20:39:57 - 1.11 +++ ValidatorTestSuite.java 5 Oct 2003 16:47:27 - 1.12 @@ -23,20 +23,20 @@ *distribution. * * 3. The end-user documentation included with the redistribution, if - *any, must include the following acknowlegement: + *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this