seade       2003/11/09 20:26:00

  Modified:    intake/xdocs changes.xml
               intake/src/java/org/apache/fulcrum/intake/validator
                        DateStringValidator.java
  Log:
  Porting changes from Turbine: 
   Fixed the intake DateString flexible rule so that it applies to the format rules 
and not just to the default locale format.
  
  Revision  Changes    Path
  1.6       +5 -1      jakarta-turbine-fulcrum/intake/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/intake/xdocs/changes.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- changes.xml       10 Nov 2003 04:05:42 -0000      1.5
  +++ changes.xml       10 Nov 2003 04:26:00 -0000      1.6
  @@ -31,7 +31,7 @@
          <em>$group.foo.StringValue</em> rather than <em>$group.foo.Value</em> 
          (you can do this for all values, not just DateString).
         </action>
  -      <action>
  +      <action dev="seade" type="fix">
          Intake now makes use of the the emptyValue attribute from the field 
          elements when mapping from the group to the object when no value has 
          been set.  This makes it possible to clear values in an existing object
  @@ -41,6 +41,10 @@
          the primary key for the object in the intake group without actually 
          setting it to the appropriate value (it shouldn't be in the group 
          anyway).
  +      </action>
  +      <action dev="seade" type="fix">
  +       Fixed the intake DateString flexible rule so that it applies to the
  +       format rules and not just to the default locale format.
         </action>
        
       </release>
  
  
  
  1.3       +6 -6      
jakarta-turbine-fulcrum/intake/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java
  
  Index: DateStringValidator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-fulcrum/intake/src/java/org/apache/fulcrum/intake/validator/DateStringValidator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DateStringValidator.java  10 Nov 2003 03:49:37 -0000      1.2
  +++ DateStringValidator.java  10 Nov 2003 04:26:00 -0000      1.3
  @@ -88,7 +88,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Quinton McCombs</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Colin Chalmers</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">J&uuml;rgen Hoffmann</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]">Scott Eade</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]">Scott Eade</a>
    * @version $Id$
    */
   public class DateStringValidator
  @@ -170,15 +170,15 @@
               flexible = Boolean.valueOf(constraint.getValue()).booleanValue();
           }
   
  -        if (dateFormats.size() == 0 || flexible)
  +        if (dateFormats.size() == 0)
           {
               df = DateFormat.getInstance();
  -            df.setLenient(true);
  +            df.setLenient(flexible);
           }
  -
  -        if (dateFormats.size() != 0)
  +        else
           {
               sdf = new SimpleDateFormat();
  +            sdf.setLenient(flexible);
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to